From d67fa451dae5622737224993e000a19587c1fa0b Mon Sep 17 00:00:00 2001 From: songlu <37168047+PARADISSEEKR@users.noreply.github.com> Date: Thu, 19 Jan 2023 12:31:10 +0800 Subject: [PATCH] [Mobil-Network] Mobile.Network GA Release (#5644) --- .github/CODEOWNERS | 2 + src/mobile-network/HISTORY.rst | 8 + src/mobile-network/README.md | 296 +++ .../azext_mobile_network/__init__.py | 42 + .../azext_mobile_network/_help.py | 11 + .../azext_mobile_network/_params.py | 13 + .../azext_mobile_network/aaz/__init__.py | 6 + .../aaz/latest/__init__.py | 6 + .../aaz/latest/mobile_network/__cmd_group.py | 23 + .../aaz/latest/mobile_network/__init__.py | 17 + .../aaz/latest/mobile_network/_create.py | 326 +++ .../aaz/latest/mobile_network/_delete.py | 167 ++ .../aaz/latest/mobile_network/_list.py | 384 ++++ .../aaz/latest/mobile_network/_show.py | 233 +++ .../aaz/latest/mobile_network/_update.py | 263 +++ .../aaz/latest/mobile_network/_wait.py | 229 +++ .../attached_data_network/__cmd_group.py | 23 + .../attached_data_network/__init__.py | 17 + .../attached_data_network/_create.py | 601 ++++++ .../attached_data_network/_delete.py | 195 ++ .../attached_data_network/_list.py | 309 +++ .../attached_data_network/_show.py | 315 +++ .../attached_data_network/_update.py | 761 +++++++ .../attached_data_network/_wait.py | 311 +++ .../data_network/__cmd_group.py | 23 + .../mobile_network/data_network/__init__.py | 17 + .../mobile_network/data_network/_create.py | 300 +++ .../mobile_network/data_network/_delete.py | 181 ++ .../mobile_network/data_network/_list.py | 227 ++ .../mobile_network/data_network/_show.py | 232 +++ .../mobile_network/data_network/_update.py | 445 ++++ .../mobile_network/data_network/_wait.py | 228 ++ .../latest/mobile_network/pccp/__cmd_group.py | 23 + .../latest/mobile_network/pccp/__init__.py | 20 + .../pccp/_collect_diagnostics_package.py | 278 +++ .../aaz/latest/mobile_network/pccp/_create.py | 717 +++++++ .../aaz/latest/mobile_network/pccp/_delete.py | 167 ++ .../aaz/latest/mobile_network/pccp/_list.py | 675 ++++++ .../latest/mobile_network/pccp/_reinstall.py | 254 +++ .../latest/mobile_network/pccp/_rollback.py | 254 +++ .../aaz/latest/mobile_network/pccp/_show.py | 387 ++++ .../aaz/latest/mobile_network/pccp/_update.py | 859 ++++++++ .../aaz/latest/mobile_network/pccp/_wait.py | 383 ++++ .../pccp/version/__cmd_group.py | 23 + .../mobile_network/pccp/version/__init__.py | 13 + .../mobile_network/pccp/version/_list.py | 200 ++ .../mobile_network/pccp/version/_show.py | 218 ++ .../latest/mobile_network/pcdp/__cmd_group.py | 23 + .../latest/mobile_network/pcdp/__init__.py | 17 + .../aaz/latest/mobile_network/pcdp/_create.py | 350 ++++ .../aaz/latest/mobile_network/pcdp/_delete.py | 181 ++ .../aaz/latest/mobile_network/pcdp/_list.py | 242 +++ .../aaz/latest/mobile_network/pcdp/_show.py | 247 +++ .../aaz/latest/mobile_network/pcdp/_update.py | 277 +++ .../aaz/latest/mobile_network/pcdp/_wait.py | 243 +++ .../mobile_network/service/__cmd_group.py | 23 + .../latest/mobile_network/service/__init__.py | 17 + .../latest/mobile_network/service/_create.py | 721 +++++++ .../latest/mobile_network/service/_delete.py | 181 ++ .../latest/mobile_network/service/_list.py | 349 ++++ .../latest/mobile_network/service/_show.py | 354 ++++ .../latest/mobile_network/service/_update.py | 862 ++++++++ .../latest/mobile_network/service/_wait.py | 350 ++++ .../latest/mobile_network/sim/__cmd_group.py | 23 + .../aaz/latest/mobile_network/sim/__init__.py | 16 + .../aaz/latest/mobile_network/sim/_create.py | 469 +++++ .../aaz/latest/mobile_network/sim/_delete.py | 181 ++ .../aaz/latest/mobile_network/sim/_list.py | 288 +++ .../aaz/latest/mobile_network/sim/_show.py | 293 +++ .../aaz/latest/mobile_network/sim/_wait.py | 289 +++ .../mobile_network/sim/group/__cmd_group.py | 23 + .../mobile_network/sim/group/__init__.py | 17 + .../mobile_network/sim/group/_create.py | 394 ++++ .../mobile_network/sim/group/_delete.py | 167 ++ .../latest/mobile_network/sim/group/_list.py | 444 ++++ .../latest/mobile_network/sim/group/_show.py | 263 +++ .../mobile_network/sim/group/_update.py | 539 +++++ .../latest/mobile_network/sim/group/_wait.py | 259 +++ .../mobile_network/sim/policy/__cmd_group.py | 23 + .../mobile_network/sim/policy/__init__.py | 17 + .../mobile_network/sim/policy/_create.py | 741 +++++++ .../mobile_network/sim/policy/_delete.py | 181 ++ .../latest/mobile_network/sim/policy/_list.py | 378 ++++ .../latest/mobile_network/sim/policy/_show.py | 383 ++++ .../mobile_network/sim/policy/_update.py | 880 ++++++++ .../latest/mobile_network/sim/policy/_wait.py | 379 ++++ .../latest/mobile_network/site/__cmd_group.py | 23 + .../latest/mobile_network/site/__init__.py | 17 + .../aaz/latest/mobile_network/site/_create.py | 297 +++ .../aaz/latest/mobile_network/site/_delete.py | 181 ++ .../aaz/latest/mobile_network/site/_list.py | 238 +++ .../aaz/latest/mobile_network/site/_show.py | 243 +++ .../aaz/latest/mobile_network/site/_update.py | 441 ++++ .../aaz/latest/mobile_network/site/_wait.py | 239 +++ .../mobile_network/slice/__cmd_group.py | 23 + .../latest/mobile_network/slice/__init__.py | 17 + .../latest/mobile_network/slice/_create.py | 339 +++ .../latest/mobile_network/slice/_delete.py | 181 ++ .../aaz/latest/mobile_network/slice/_list.py | 236 +++ .../aaz/latest/mobile_network/slice/_show.py | 241 +++ .../latest/mobile_network/slice/_update.py | 483 +++++ .../aaz/latest/mobile_network/slice/_wait.py | 237 +++ .../azext_mobile_network/azext_metadata.json | 4 + .../azext_mobile_network/commands.py | 15 + .../azext_mobile_network/custom.py | 14 + .../azext_mobile_network/tests/__init__.py | 6 + .../tests/latest/__init__.py | 6 + .../recordings/test_mobile_network.yaml | 299 +++ ..._mobile_network_attached_data_network.yaml | 1825 +++++++++++++++++ .../test_mobile_network_data_network.yaml | 814 ++++++++ .../recordings/test_mobile_network_pccp.yaml | 1207 +++++++++++ .../recordings/test_mobile_network_pcdp.yaml | 1153 +++++++++++ .../test_mobile_network_service.yaml | 1003 +++++++++ .../recordings/test_mobile_network_sim.yaml | 1309 ++++++++++++ .../recordings/test_mobile_network_site.yaml | 552 +++++ .../recordings/test_mobile_network_slice.yaml | 999 +++++++++ .../tests/latest/test_mobile_network.py | 444 ++++ src/mobile-network/setup.cfg | 1 + src/mobile-network/setup.py | 49 + src/service_name.json | 5 + 120 files changed, 34907 insertions(+) create mode 100644 src/mobile-network/HISTORY.rst create mode 100644 src/mobile-network/README.md create mode 100644 src/mobile-network/azext_mobile_network/__init__.py create mode 100644 src/mobile-network/azext_mobile_network/_help.py create mode 100644 src/mobile-network/azext_mobile_network/_params.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/__init__.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/__init__.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/__cmd_group.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/__init__.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/_create.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/_delete.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/_list.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/_show.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/_update.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/_wait.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/attached_data_network/__cmd_group.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/attached_data_network/__init__.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/attached_data_network/_create.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/attached_data_network/_delete.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/attached_data_network/_list.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/attached_data_network/_show.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/attached_data_network/_update.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/attached_data_network/_wait.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/data_network/__cmd_group.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/data_network/__init__.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/data_network/_create.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/data_network/_delete.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/data_network/_list.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/data_network/_show.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/data_network/_update.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/data_network/_wait.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/__cmd_group.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/__init__.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/_collect_diagnostics_package.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/_create.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/_delete.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/_list.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/_reinstall.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/_rollback.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/_show.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/_update.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/_wait.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/version/__cmd_group.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/version/__init__.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/version/_list.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/version/_show.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pcdp/__cmd_group.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pcdp/__init__.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pcdp/_create.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pcdp/_delete.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pcdp/_list.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pcdp/_show.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pcdp/_update.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pcdp/_wait.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/service/__cmd_group.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/service/__init__.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/service/_create.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/service/_delete.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/service/_list.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/service/_show.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/service/_update.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/service/_wait.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/__cmd_group.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/__init__.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/_create.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/_delete.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/_list.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/_show.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/_wait.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/group/__cmd_group.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/group/__init__.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/group/_create.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/group/_delete.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/group/_list.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/group/_show.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/group/_update.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/group/_wait.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/policy/__cmd_group.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/policy/__init__.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/policy/_create.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/policy/_delete.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/policy/_list.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/policy/_show.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/policy/_update.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/policy/_wait.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/site/__cmd_group.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/site/__init__.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/site/_create.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/site/_delete.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/site/_list.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/site/_show.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/site/_update.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/site/_wait.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/slice/__cmd_group.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/slice/__init__.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/slice/_create.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/slice/_delete.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/slice/_list.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/slice/_show.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/slice/_update.py create mode 100644 src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/slice/_wait.py create mode 100644 src/mobile-network/azext_mobile_network/azext_metadata.json create mode 100644 src/mobile-network/azext_mobile_network/commands.py create mode 100644 src/mobile-network/azext_mobile_network/custom.py create mode 100644 src/mobile-network/azext_mobile_network/tests/__init__.py create mode 100644 src/mobile-network/azext_mobile_network/tests/latest/__init__.py create mode 100644 src/mobile-network/azext_mobile_network/tests/latest/recordings/test_mobile_network.yaml create mode 100644 src/mobile-network/azext_mobile_network/tests/latest/recordings/test_mobile_network_attached_data_network.yaml create mode 100644 src/mobile-network/azext_mobile_network/tests/latest/recordings/test_mobile_network_data_network.yaml create mode 100644 src/mobile-network/azext_mobile_network/tests/latest/recordings/test_mobile_network_pccp.yaml create mode 100644 src/mobile-network/azext_mobile_network/tests/latest/recordings/test_mobile_network_pcdp.yaml create mode 100644 src/mobile-network/azext_mobile_network/tests/latest/recordings/test_mobile_network_service.yaml create mode 100644 src/mobile-network/azext_mobile_network/tests/latest/recordings/test_mobile_network_sim.yaml create mode 100644 src/mobile-network/azext_mobile_network/tests/latest/recordings/test_mobile_network_site.yaml create mode 100644 src/mobile-network/azext_mobile_network/tests/latest/recordings/test_mobile_network_slice.yaml create mode 100644 src/mobile-network/azext_mobile_network/tests/latest/test_mobile_network.py create mode 100644 src/mobile-network/setup.cfg create mode 100644 src/mobile-network/setup.py diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index d2e4b1c16fa..695d660d7ec 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -265,3 +265,5 @@ /src/nsp/ @nikhilsaxena2609 /src/billing-benefits/ @gaoyp830 @rkapso @msft-adrianma @sornaks + +/src/mobile-network/ @jsntcy diff --git a/src/mobile-network/HISTORY.rst b/src/mobile-network/HISTORY.rst new file mode 100644 index 00000000000..8c34bccfff8 --- /dev/null +++ b/src/mobile-network/HISTORY.rst @@ -0,0 +1,8 @@ +.. :changelog: + +Release History +=============== + +0.1.0 +++++++ +* Initial release. \ No newline at end of file diff --git a/src/mobile-network/README.md b/src/mobile-network/README.md new file mode 100644 index 00000000000..824b050033d --- /dev/null +++ b/src/mobile-network/README.md @@ -0,0 +1,296 @@ +# Azure CLI Mobile Network # +This is an extension to Azure CLI to manage mobile network resources. + +## How to use ## +Install this extension using the below CLI command +``` +az extension add --name mobile-network +``` + +### Included Features ### +#### mobile-network #### +##### Create ##### +``` +az mobile-network create -n mobile-network-name -g rg --identifier "{mcc:001,mnc:01}" + +``` +##### Show ##### +``` +az mobile-network show -n mobile-network-name -g rg +``` +##### List ##### +``` +az mobile-network list -g rg +``` +##### Update ##### +``` +az mobile-network update -n mobile-network-name -g rg --tags "{tag:test,tag2:test2}" +``` + +##### Delete ##### +``` +az mobile-network delete -n mobile-network-name -g rg -y + +``` + +#### attached-data-network #### +##### Create ##### +``` +az mobile-network attached-data-network create -n data-network-name -g rg --pccp-name pccp-name --pcdp-name pcdp-name --dns-addresses "[1.1.1.1]" --data-interface " {name:N2,ipv4Address:10.28.128.2,ipv4Subnet:10.28.128.0/24,ipv4Gateway:10.28.128.1}" + +``` +##### Show ##### +``` +az mobile-network attached-data-network show -n data-network-name --pccp-name pccp-name --pcdp-name pcdp-name -g rg +``` +##### List ##### +``` +az mobile-network attached-data-network list -g rg --pccp-name pccp-name --pcdp-name pcdp-name +``` +##### Update ##### +``` +az mobile-network attached-data-network update -n data_network-name -g rg --pccp-name pccp-name --pcdp-name pcdp-name --tags "{tag:test,tag2:test2}" +``` + +##### Delete ##### +``` +az mobile-network attached-data-network delete -n data-network-name --pccp-name pccp-name --pcdp-name pcdp-name -g rg -y + +``` + +#### data-network #### +##### Create ##### +``` +az mobile-network data-network create -n data-network-name -g rg --mobile-network-name mobile-network-name + +``` +##### Show ##### +``` +az mobile-network data-network show -n data-network-name --mobile-network-name mobile-network-name -g rg +``` +##### List ##### +``` +az mobile-network data-network list --mobile-network-name mobile-network-name -g rg +``` +##### Update ##### +``` +az mobile-network data-network update -n data-network-name -g rg --mobile-network-name mobile-network-name --tags "{tag:test,tag2:test2}" +``` + +##### Delete ##### +``` +az mobile-network data-network delete -n data_network-name --mobile-network-name mobile-network-name -g rg -y + +``` + + +#### Packet Core Control Plane #### +##### Create ##### +``` +az mobile-network pccp create -n pccp-name -g rg --access-interface "{name:N2,ipv4Address:10.28.128.2,ipv4Subnet:10.28.128.0/24,ipv4Gateway:10.28.128.1}" --local-diagnostics "{authentication-type:AAD}" --platform "{type:AKS-HCI}" --sites "[{id:site-id}]" --sku G0 + +``` +##### Show ##### +``` +az mobile-network pccp show -n pccp-name -g rg +``` +##### List ##### +``` +az mobile-network pccp list -g rg +``` +##### Update ##### +``` +az mobile-network pccp update -n pccp-name -g rg --ue-mtu 1500 --tags "{tag:test,tag2:test2}" +``` + +##### collect-diagnostics-package ##### +``` +az mobile-network pccp collect-diagnostics-package --pccp-name pccp -g rg --blob-url https://contosoaccount.blob.core.windows.net/container/diagnosticsPackage.zip +``` + +##### reinstall ##### +``` +az mobile-network pccp reinstall --pccp-name pccp-name -g rg +``` + +##### rollback ##### +``` +az mobile-network pccp rollback --pccp-name pccp-name -g rg +``` + +##### Delete ##### +``` +az mobile-network pccp delete -n pccp-name -g rg -y + +``` + +#### Packet Core Data Plane #### +##### Create ##### +``` +az mobile-network pcdp create -n pcdp-name -g rg --pccp-name pccp-name --access-interface "{name:N2,ipv4Address:10.28.128.2,ipv4Subnet:10.28.128.0/24,ipv4Gateway:10.28.128.1}" + +``` +##### Show ##### +``` +az mobile-network pcdp show -g rg -n pcdp-name --pccp-name pccp-name +``` +##### List ##### +``` +az mobile-network pcdp list -g rg --pccp-name pccp_name +``` +##### Update ##### +``` +az mobile-network pcdp update -n pcdp_name -g rg --pccp-name pccp-name --tags "{tag:test,tag2:test2}" +``` + +##### Delete ##### +``` +az mobile-network pcdp delete -g rg -n pcdp-name --pccp-name pccp-name -y + +``` + +#### service #### +##### Create ##### +``` +az mobile-network service create -n service-name -g rg --mobile-network-name mobile-network-name --pcc-rules "[{ruleName:default-rule,rulePrecedence:10,serviceDataFlowTemplates:[{templateName:IP-to-server,direction:Uplink,protocol:[ip],remoteIpList:[10.3.4.0/24]}]}]" --service-precedence 10 + +``` +##### Show ##### +``` +az mobile-network service show --mobile-network-name mobile-network-name -n service -g rg +``` +##### List ##### +``` +az mobile-network service list --mobile-network-name mobile-network-name -g rg +``` +##### Update ##### +``` +az mobile-network service update --mobile-network-name mobile-network-name -g rg -n service-name --tags "{tag:test,tag2:test2}" +``` + +##### Delete ##### +``` +az mobile-network service delete --mobile-network-name mobile-network-name -n service -g rg -y + +``` + +#### sim #### +##### Create ##### +``` +az mobile-network sim create -g rg --sim-group-name sim-group-name -n sim-name --international-msi 0000000000 --operator-key-code 00000000000000000000000000000000 --authentication-key 00000000000000000000000000000000 + +``` +##### Show ##### +``` +az mobile-network sim show -g rg -n sim-name --sim-group-name sim-group-name +``` +##### List ##### +``` +az mobile-network sim list -g rg --sim-group-name sim-group-name +``` + +##### Delete ##### +``` +az mobile-network sim delete -g rg -n sim-name --sim-group-name sim-group-name -y + +``` + +#### sim group #### +##### Create ##### +``` +az mobile-network sim group create -n sim-group-name -g rg --mobile-network "{id:mobile-network-id}" + +``` +##### Show ##### +``` +az mobile-network sim group show -n sim-group-name -g rg +``` +##### List ##### +``` +az mobile-network sim group list -g rg +``` +##### Update ##### +``` +az mobile-network sim group update -n sim-group-name -g rg --tags "{tag:test,tag2:test2}" +``` + +##### Delete ##### +``` +az mobile-network sim group delete -n sim-group-name -g rg -y + +``` + +#### sim policy #### +##### Create ##### +``` +az mobile-network sim policy create -g rg -n sim-policy-name --mobile-network-name mobile-network-name --default-slice '{id:slice-id}' --slice-config "[{slice:{id:slice-id},defaultDataNetwork:{id:data-network-id},dataNetworkConfigurations:[{dataNetwork:{id:data-network-id},allowedServices:[{id:service-id}],sessionAmbr:{uplink:'500 Mbps',downlink:'1 Gbps'}}]}]" --ue-ambr "{uplink:'500 Mbps',downlink:'1 Gbps'}" + +``` +##### Show ##### +``` +az mobile-network sim policy show -g rg -n sim-policy-name --mobile-network-name mobile-network-name +``` +##### List ##### +``` +az mobile-network sim policy list -g rg --mobile-network-name mobile-network-name +``` +##### Update ##### +``` +az mobile-network sim policy update -g rg-n sim-policy-name --mobile-network-name mobile-network-name --tags "{tag:test,tag2:test2}" +``` + +##### Delete ##### +``` +az mobile-network sim policy delete -g rg -n sim-policy-name --mobile-network-name mobile-network-name + +``` + +#### site #### +##### Create ##### +``` +az mobile-network create -n mobile-network-name -g rg --identifier "{mcc:001,mnc:01}" + +``` +##### Show ##### +``` +az mobile-network site show--mobile-network-name mobile-network-name -n site-name -g rg +``` +##### List ##### +``` +az mobile-network site list --mobile-network-name mobile-network-name -g rg +``` +##### Update ##### +``` +az mobile-network site update --mobile-network-name mobile-network-name -n site-name -g rg --tags "{tag:test,tag2:test2}" +``` + +##### Delete ##### +``` +az mobile-network site delete --mobile-network-name mobile-network-name -n site-name -g rg -y' + +``` + +#### slice #### +##### Create ##### +``` +az mobile-network slice create --mobile-network-name mobile-network-name -n slice-name -g rg --snssai "{sst:1,sd:123abc}" + +``` +##### Show ##### +``` +az mobile-network slice show --mobile-network-name mobile=network-name -n slice-name -g rg +``` +##### List ##### +``` +az mobile-network slice list --mobile-network-name mobile-network-name -g rg +``` +##### Update ##### +``` +az mobile-network slice update --mobile-network-name mobile-network-name -n slice-name -g rg --tags "{tag:test,tag2:test2}" +``` + +##### Delete ##### +``` +az mobile-network slice delete --mobile-network-name mobilenetwork-name -n slice-name -g rg -y + +``` diff --git a/src/mobile-network/azext_mobile_network/__init__.py b/src/mobile-network/azext_mobile_network/__init__.py new file mode 100644 index 00000000000..4653c8a7f8f --- /dev/null +++ b/src/mobile-network/azext_mobile_network/__init__.py @@ -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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +from azure.cli.core import AzCommandsLoader +from azext_mobile_network._help import helps # pylint: disable=unused-import + + +class MobileNetworkCommandsLoader(AzCommandsLoader): + + def __init__(self, cli_ctx=None): + from azure.cli.core.commands import CliCommandType + custom_command_type = CliCommandType( + operations_tmpl='azext_mobile_network.custom#{}') + super().__init__(cli_ctx=cli_ctx, + custom_command_type=custom_command_type) + + def load_command_table(self, args): + from azext_mobile_network.commands import load_command_table + from azure.cli.core.aaz import load_aaz_command_table + try: + from . import aaz + except ImportError: + aaz = None + if aaz: + load_aaz_command_table( + loader=self, + aaz_pkg_name=aaz.__name__, + args=args + ) + load_command_table(self, args) + return self.command_table + + def load_arguments(self, command): + from azext_mobile_network._params import load_arguments + load_arguments(self, command) + + +COMMAND_LOADER_CLS = MobileNetworkCommandsLoader diff --git a/src/mobile-network/azext_mobile_network/_help.py b/src/mobile-network/azext_mobile_network/_help.py new file mode 100644 index 00000000000..126d5d00714 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/_help.py @@ -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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: disable=line-too-long +# pylint: disable=too-many-lines + +from knack.help_files import helps # pylint: disable=unused-import diff --git a/src/mobile-network/azext_mobile_network/_params.py b/src/mobile-network/azext_mobile_network/_params.py new file mode 100644 index 00000000000..cfcec717c9c --- /dev/null +++ b/src/mobile-network/azext_mobile_network/_params.py @@ -0,0 +1,13 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: disable=too-many-lines +# pylint: disable=too-many-statements + + +def load_arguments(self, _): # pylint: disable=unused-argument + pass diff --git a/src/mobile-network/azext_mobile_network/aaz/__init__.py b/src/mobile-network/azext_mobile_network/aaz/__init__.py new file mode 100644 index 00000000000..5757aea3175 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/__init__.py @@ -0,0 +1,6 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/__init__.py b/src/mobile-network/azext_mobile_network/aaz/latest/__init__.py new file mode 100644 index 00000000000..5757aea3175 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/__init__.py @@ -0,0 +1,6 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/__cmd_group.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/__cmd_group.py new file mode 100644 index 00000000000..b8ced1ecc4d --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/__cmd_group.py @@ -0,0 +1,23 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command_group( + "mobile-network", +) +class __CMDGroup(AAZCommandGroup): + """Manage mobile network + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/__init__.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/__init__.py new file mode 100644 index 00000000000..db73033039b --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/__init__.py @@ -0,0 +1,17 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * +from ._create import * +from ._delete import * +from ._list import * +from ._show import * +from ._update import * +from ._wait import * diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/_create.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/_create.py new file mode 100644 index 00000000000..2c6216e5c95 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/_create.py @@ -0,0 +1,326 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network create", +) +class Create(AAZCommand): + """Create a mobile network. + + :example: Create mobile-network + az mobile-network create -n mobile-network-name -g rg --identifier "{mcc:001,mnc:01}" + """ + + _aaz_info = { + "version": "2022-11-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/mobilenetworks/{}", "2022-11-01"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.mobile_network_name = AAZStrArg( + options=["-n", "--name", "--mobile-network-name"], + help="The name of the mobile network.", + required=True, + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + + # define Arg Group "Parameters" + + _args_schema = cls._args_schema + _args_schema.location = AAZResourceLocationArg( + arg_group="Parameters", + help="The geo-location where the resource lives", + required=True, + fmt=AAZResourceLocationArgFormat( + resource_group_arg="resource_group", + ), + ) + _args_schema.tags = AAZDictArg( + options=["--tags"], + arg_group="Parameters", + help="Resource tags.", + ) + + tags = cls._args_schema.tags + tags.Element = AAZStrArg() + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.identifier = AAZObjectArg( + options=["--identifier"], + arg_group="Properties", + help="The unique public land mobile network identifier for the network. This is made up of the mobile country code and mobile network code, as defined in https://www.itu.int/rec/T-REC-E.212. The values 001-01 and 001-001 can be used for testing and the values 999-99 and 999-999 can be used on internal private networks.", + required=True, + ) + + identifier = cls._args_schema.identifier + identifier.mcc = AAZStrArg( + options=["mcc"], + help="Mobile country code (MCC).", + required=True, + fmt=AAZStrArgFormat( + pattern="^\d{3}$", + ), + ) + identifier.mnc = AAZStrArg( + options=["mnc"], + help="Mobile network code (MNC).", + required=True, + fmt=AAZStrArgFormat( + pattern="^\d{2,3}$", + ), + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + yield self.MobileNetworksCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class MobileNetworksCreateOrUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200, 201]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/mobileNetworks/{mobileNetworkName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "mobileNetworkName", self.ctx.args.mobile_network_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + typ=AAZObjectType, + typ_kwargs={"flags": {"required": True, "client_flatten": True}} + ) + _builder.set_prop("location", AAZStrType, ".location", typ_kwargs={"flags": {"required": True}}) + _builder.set_prop("properties", AAZObjectType, ".", typ_kwargs={"flags": {"required": True, "client_flatten": True}}) + _builder.set_prop("tags", AAZDictType, ".tags") + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("publicLandMobileNetworkIdentifier", AAZObjectType, ".identifier", typ_kwargs={"flags": {"required": True}}) + + public_land_mobile_network_identifier = _builder.get(".properties.publicLandMobileNetworkIdentifier") + if public_land_mobile_network_identifier is not None: + public_land_mobile_network_identifier.set_prop("mcc", AAZStrType, ".mcc", typ_kwargs={"flags": {"required": True}}) + public_land_mobile_network_identifier.set_prop("mnc", AAZStrType, ".mnc", typ_kwargs={"flags": {"required": True}}) + + tags = _builder.get(".tags") + if tags is not None: + tags.set_elements(AAZStrType, ".") + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + + _schema_on_200_201 = cls._schema_on_200_201 + _schema_on_200_201.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.location = AAZStrType( + flags={"required": True}, + ) + _schema_on_200_201.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.properties = AAZObjectType( + flags={"required": True, "client_flatten": True}, + ) + _schema_on_200_201.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200_201.tags = AAZDictType() + _schema_on_200_201.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200_201.properties + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.public_land_mobile_network_identifier = AAZObjectType( + serialized_name="publicLandMobileNetworkIdentifier", + flags={"required": True}, + ) + properties.service_key = AAZStrType( + serialized_name="serviceKey", + flags={"read_only": True}, + ) + + public_land_mobile_network_identifier = cls._schema_on_200_201.properties.public_land_mobile_network_identifier + public_land_mobile_network_identifier.mcc = AAZStrType( + flags={"required": True}, + ) + public_land_mobile_network_identifier.mnc = AAZStrType( + flags={"required": True}, + ) + + system_data = cls._schema_on_200_201.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200_201.tags + tags.Element = AAZStrType() + + return cls._schema_on_200_201 + + +class _CreateHelper: + """Helper class for Create""" + + +__all__ = ["Create"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/_delete.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/_delete.py new file mode 100644 index 00000000000..92362b73545 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/_delete.py @@ -0,0 +1,167 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network delete", + confirmation="Are you sure you want to perform this operation?", +) +class Delete(AAZCommand): + """Delete the specified mobile network. + + :example: Delete mobile-network + az mobile-network delete -n mobile-network-name -g rg -y + """ + + _aaz_info = { + "version": "2022-11-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/mobilenetworks/{}", "2022-11-01"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, None) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.mobile_network_name = AAZStrArg( + options=["-n", "--name", "--mobile-network-name"], + help="The name of the mobile network.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + yield self.MobileNetworksDelete(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + class MobileNetworksDelete(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [204]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_204, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/mobileNetworks/{mobileNetworkName}", + **self.url_parameters + ) + + @property + def method(self): + return "DELETE" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "mobileNetworkName", self.ctx.args.mobile_network_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + def on_200(self, session): + pass + + def on_204(self, session): + pass + + +class _DeleteHelper: + """Helper class for Delete""" + + +__all__ = ["Delete"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/_list.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/_list.py new file mode 100644 index 00000000000..ec630e3c9dc --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/_list.py @@ -0,0 +1,384 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network list", +) +class List(AAZCommand): + """List all the mobile networks in a subscription. + + :example: List mobile-network by resource group + az mobile-network list -g rg + """ + + _aaz_info = { + "version": "2022-11-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/providers/microsoft.mobilenetwork/mobilenetworks", "2022-11-01"], + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/mobilenetworks", "2022-11-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_paging(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.resource_group = AAZResourceGroupNameArg() + return cls._args_schema + + 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 + if condition_0: + self.MobileNetworksListByResourceGroup(ctx=self.ctx)() + if condition_1: + self.MobileNetworksListBySubscription(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) + next_link = self.deserialize_output(self.ctx.vars.instance.next_link) + return result, next_link + + class MobileNetworksListByResourceGroup(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/mobileNetworks", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @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, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.next_link = AAZStrType( + serialized_name="nextLink", + flags={"read_only": True}, + ) + _schema_on_200.value = AAZListType() + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.location = AAZStrType( + flags={"required": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType( + flags={"required": True, "client_flatten": True}, + ) + _element.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _element.tags = AAZDictType() + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.public_land_mobile_network_identifier = AAZObjectType( + serialized_name="publicLandMobileNetworkIdentifier", + flags={"required": True}, + ) + properties.service_key = AAZStrType( + serialized_name="serviceKey", + flags={"read_only": True}, + ) + + public_land_mobile_network_identifier = cls._schema_on_200.value.Element.properties.public_land_mobile_network_identifier + public_land_mobile_network_identifier.mcc = AAZStrType( + flags={"required": True}, + ) + public_land_mobile_network_identifier.mnc = AAZStrType( + flags={"required": True}, + ) + + system_data = cls._schema_on_200.value.Element.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.value.Element.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + class MobileNetworksListBySubscription(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/providers/Microsoft.MobileNetwork/mobileNetworks", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.next_link = AAZStrType( + serialized_name="nextLink", + flags={"read_only": True}, + ) + _schema_on_200.value = AAZListType() + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.location = AAZStrType( + flags={"required": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType( + flags={"required": True, "client_flatten": True}, + ) + _element.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _element.tags = AAZDictType() + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.public_land_mobile_network_identifier = AAZObjectType( + serialized_name="publicLandMobileNetworkIdentifier", + flags={"required": True}, + ) + properties.service_key = AAZStrType( + serialized_name="serviceKey", + flags={"read_only": True}, + ) + + public_land_mobile_network_identifier = cls._schema_on_200.value.Element.properties.public_land_mobile_network_identifier + public_land_mobile_network_identifier.mcc = AAZStrType( + flags={"required": True}, + ) + public_land_mobile_network_identifier.mnc = AAZStrType( + flags={"required": True}, + ) + + system_data = cls._schema_on_200.value.Element.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.value.Element.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _ListHelper: + """Helper class for List""" + + +__all__ = ["List"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/_show.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/_show.py new file mode 100644 index 00000000000..ce3263ffae0 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/_show.py @@ -0,0 +1,233 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network show", +) +class Show(AAZCommand): + """Get information about the specified mobile network. + + :example: Show mobile-network + az mobile-network show -n mobile-network-name -g rg + """ + + _aaz_info = { + "version": "2022-11-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/mobilenetworks/{}", "2022-11-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.mobile_network_name = AAZStrArg( + options=["-n", "--name", "--mobile-network-name"], + help="The name of the mobile network.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.MobileNetworksGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class MobileNetworksGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/mobileNetworks/{mobileNetworkName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "mobileNetworkName", self.ctx.args.mobile_network_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.location = AAZStrType( + flags={"required": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType( + flags={"required": True, "client_flatten": True}, + ) + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.public_land_mobile_network_identifier = AAZObjectType( + serialized_name="publicLandMobileNetworkIdentifier", + flags={"required": True}, + ) + properties.service_key = AAZStrType( + serialized_name="serviceKey", + flags={"read_only": True}, + ) + + public_land_mobile_network_identifier = cls._schema_on_200.properties.public_land_mobile_network_identifier + public_land_mobile_network_identifier.mcc = AAZStrType( + flags={"required": True}, + ) + public_land_mobile_network_identifier.mnc = AAZStrType( + flags={"required": True}, + ) + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _ShowHelper: + """Helper class for Show""" + + +__all__ = ["Show"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/_update.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/_update.py new file mode 100644 index 00000000000..15af4d210ea --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/_update.py @@ -0,0 +1,263 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network update", +) +class Update(AAZCommand): + """Update mobile network tags. + + :example: Update mobile-network tags + az mobile-network update -n mobile-network-name -g rg --tags "{tag:test,tag2:test2}" + """ + + _aaz_info = { + "version": "2022-11-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/mobilenetworks/{}", "2022-11-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.mobile_network_name = AAZStrArg( + options=["-n", "--name", "--mobile-network-name"], + help="The name of the mobile network.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + + # define Arg Group "Parameters" + + _args_schema = cls._args_schema + _args_schema.tags = AAZDictArg( + options=["--tags"], + arg_group="Parameters", + help="Resource tags.", + ) + + tags = cls._args_schema.tags + tags.Element = AAZStrArg() + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.MobileNetworksUpdateTags(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class MobileNetworksUpdateTags(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/mobileNetworks/{mobileNetworkName}", + **self.url_parameters + ) + + @property + def method(self): + return "PATCH" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "mobileNetworkName", self.ctx.args.mobile_network_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + typ=AAZObjectType, + typ_kwargs={"flags": {"required": True, "client_flatten": True}} + ) + _builder.set_prop("tags", AAZDictType, ".tags") + + tags = _builder.get(".tags") + if tags is not None: + tags.set_elements(AAZStrType, ".") + + return self.serialize_content(_content_value) + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.location = AAZStrType( + flags={"required": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType( + flags={"required": True, "client_flatten": True}, + ) + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.public_land_mobile_network_identifier = AAZObjectType( + serialized_name="publicLandMobileNetworkIdentifier", + flags={"required": True}, + ) + properties.service_key = AAZStrType( + serialized_name="serviceKey", + flags={"read_only": True}, + ) + + public_land_mobile_network_identifier = cls._schema_on_200.properties.public_land_mobile_network_identifier + public_land_mobile_network_identifier.mcc = AAZStrType( + flags={"required": True}, + ) + public_land_mobile_network_identifier.mnc = AAZStrType( + flags={"required": True}, + ) + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _UpdateHelper: + """Helper class for Update""" + + +__all__ = ["Update"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/_wait.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/_wait.py new file mode 100644 index 00000000000..534af607a36 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/_wait.py @@ -0,0 +1,229 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network wait", +) +class Wait(AAZWaitCommand): + """Place the CLI in a waiting state until a condition is met. + """ + + _aaz_info = { + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/mobilenetworks/{}", "2022-11-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.mobile_network_name = AAZStrArg( + options=["-n", "--name", "--mobile-network-name"], + help="The name of the mobile network.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.MobileNetworksGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) + return result + + class MobileNetworksGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/mobileNetworks/{mobileNetworkName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "mobileNetworkName", self.ctx.args.mobile_network_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.location = AAZStrType( + flags={"required": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType( + flags={"required": True, "client_flatten": True}, + ) + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.public_land_mobile_network_identifier = AAZObjectType( + serialized_name="publicLandMobileNetworkIdentifier", + flags={"required": True}, + ) + properties.service_key = AAZStrType( + serialized_name="serviceKey", + flags={"read_only": True}, + ) + + public_land_mobile_network_identifier = cls._schema_on_200.properties.public_land_mobile_network_identifier + public_land_mobile_network_identifier.mcc = AAZStrType( + flags={"required": True}, + ) + public_land_mobile_network_identifier.mnc = AAZStrType( + flags={"required": True}, + ) + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _WaitHelper: + """Helper class for Wait""" + + +__all__ = ["Wait"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/attached_data_network/__cmd_group.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/attached_data_network/__cmd_group.py new file mode 100644 index 00000000000..d5a075b6765 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/attached_data_network/__cmd_group.py @@ -0,0 +1,23 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command_group( + "mobile-network attached-data-network", +) +class __CMDGroup(AAZCommandGroup): + """Manage attached data net work + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/attached_data_network/__init__.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/attached_data_network/__init__.py new file mode 100644 index 00000000000..db73033039b --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/attached_data_network/__init__.py @@ -0,0 +1,17 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * +from ._create import * +from ._delete import * +from ._list import * +from ._show import * +from ._update import * +from ._wait import * diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/attached_data_network/_create.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/attached_data_network/_create.py new file mode 100644 index 00000000000..e252402f4cd --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/attached_data_network/_create.py @@ -0,0 +1,601 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network attached-data-network create", +) +class Create(AAZCommand): + """Create an attached data network. + + :example: Create attached-data-network + az mobile-network attached-data-network create -n data-network-name -g rg --pccp-name pccp-name --pcdp-name pcdp-name --dns-addresses "[1.1.1.1]" --data-interface " {name:N2,ipv4Address:10.28.128.2,ipv4Subnet:10.28.128.0/24,ipv4Gateway:10.28.128.1}" + """ + + _aaz_info = { + "version": "2022-11-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/packetcorecontrolplanes/{}/packetcoredataplanes/{}/attacheddatanetworks/{}", "2022-11-01"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.adn_name = AAZStrArg( + options=["-n", "--name", "--adn-name"], + help="The name of the attached data network.", + required=True, + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])*(\.[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])*)*$", + max_length=64, + ), + ) + _args_schema.pccp_name = AAZStrArg( + options=["--pccp-name"], + help="The name of the packet core control plane.", + required=True, + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.pcdp_name = AAZStrArg( + options=["--pcdp-name"], + help="The name of the packet core data plane.", + required=True, + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + + # define Arg Group "Parameters" + + _args_schema = cls._args_schema + _args_schema.location = AAZResourceLocationArg( + arg_group="Parameters", + help="The geo-location where the resource lives", + required=True, + fmt=AAZResourceLocationArgFormat( + resource_group_arg="resource_group", + ), + ) + _args_schema.tags = AAZDictArg( + options=["--tags"], + arg_group="Parameters", + help="Resource tags.", + ) + + tags = cls._args_schema.tags + tags.Element = AAZStrArg() + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.dns_addresses = AAZListArg( + options=["--dns-addresses"], + arg_group="Properties", + help="The DNS servers to signal to UEs to use for this attached data network.", + required=True, + fmt=AAZListArgFormat( + unique=True, + ), + ) + _args_schema.napt_configuration = AAZObjectArg( + options=["--napt-configuration"], + arg_group="Properties", + help="The network address and port translation (NAPT) configuration. If this is not specified, the attached data network will use a default NAPT configuration with NAPT enabled.", + ) + _args_schema.address_pool = AAZListArg( + options=["--address-pool"], + arg_group="Properties", + help="The user equipment (UE) address pool prefixes for the attached data network from which the packet core instance will dynamically assign IP addresses to UEs. The packet core instance assigns an IP address to a UE when the UE sets up a PDU session. You must define at least one of userEquipmentAddressPoolPrefix and userEquipmentStaticAddressPoolPrefix. If you define both, they must be of the same size.", + fmt=AAZListArgFormat( + unique=True, + ), + ) + _args_schema.static_address_pool = AAZListArg( + options=["--static-address-pool"], + arg_group="Properties", + help="The user equipment (UE) address pool prefixes for the attached data network from which the packet core instance will assign static IP addresses to UEs. The packet core instance assigns an IP address to a UE when the UE sets up a PDU session. The static IP address for a specific UE is set in StaticIPConfiguration on the corresponding SIM resource. At least one of userEquipmentAddressPoolPrefix and userEquipmentStaticAddressPoolPrefix must be defined. If both are defined, they must be of the same size.", + fmt=AAZListArgFormat( + unique=True, + ), + ) + _args_schema.data_interface = AAZObjectArg( + options=["--data-interface"], + arg_group="Properties", + help="The user plane interface on the data network. For 5G networks, this is the N6 interface. For 4G networks, this is the SGi interface.", + required=True, + ) + + dns_addresses = cls._args_schema.dns_addresses + dns_addresses.Element = AAZStrArg( + fmt=AAZStrArgFormat( + pattern="^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$", + ), + ) + + napt_configuration = cls._args_schema.napt_configuration + napt_configuration.enabled = AAZStrArg( + options=["enabled"], + help="Whether NAPT is enabled for connections to this attached data network.", + default="Enabled", + enum={"Disabled": "Disabled", "Enabled": "Enabled"}, + ) + napt_configuration.pinhole_limits = AAZIntArg( + options=["pinhole-limits"], + help="Maximum number of UDP and TCP pinholes that can be open simultaneously on the core interface. For 5G networks, this is the N6 interface. For 4G networks, this is the SGi interface.", + default=65536, + fmt=AAZIntArgFormat( + maximum=65536, + minimum=1, + ), + ) + napt_configuration.pinhole_timeouts = AAZObjectArg( + options=["pinhole-timeouts"], + help="Expiry times of inactive NAPT pinholes, in seconds. All timers must be at least 1 second.", + ) + napt_configuration.port_range = AAZObjectArg( + options=["port-range"], + help="Range of port numbers to use as translated ports on each translated address. If not specified and NAPT is enabled, this range defaults to 1,024 - 49,999. (Ports under 1,024 should not be used because these are special purpose ports reserved by IANA. Ports 50,000 and above are reserved for non-NAPT use.)", + ) + napt_configuration.port_reuse_hold_time = AAZObjectArg( + options=["port-reuse-hold-time"], + help="The minimum time (in seconds) that will pass before a port that was used by a closed pinhole can be recycled for use by another pinhole. All hold times must be minimum 1 second.", + ) + + pinhole_timeouts = cls._args_schema.napt_configuration.pinhole_timeouts + pinhole_timeouts.icmp = AAZIntArg( + options=["icmp"], + help="Pinhole timeout for ICMP pinholes in seconds. Default for ICMP Echo is 60 seconds, as per RFC 5508 section 3.2.", + default=30, + fmt=AAZIntArgFormat( + minimum=1, + ), + ) + pinhole_timeouts.tcp = AAZIntArg( + options=["tcp"], + help="Pinhole timeout for TCP pinholes in seconds. Default for TCP is 2 hours 4 minutes, as per RFC 5382 section 5.", + default=180, + fmt=AAZIntArgFormat( + minimum=1, + ), + ) + pinhole_timeouts.udp = AAZIntArg( + options=["udp"], + help="Pinhole timeout for UDP pinholes in seconds. Default for UDP is 5 minutes, as per RFC 4787 section 4.3.", + default=30, + fmt=AAZIntArgFormat( + minimum=1, + ), + ) + + port_range = cls._args_schema.napt_configuration.port_range + port_range.max_port = AAZIntArg( + options=["max-port"], + help="The maximum port number", + default=49999, + fmt=AAZIntArgFormat( + maximum=65535, + minimum=1024, + ), + ) + port_range.min_port = AAZIntArg( + options=["min-port"], + help="The minimum port number", + default=1024, + fmt=AAZIntArgFormat( + maximum=65535, + minimum=1024, + ), + ) + + port_reuse_hold_time = cls._args_schema.napt_configuration.port_reuse_hold_time + port_reuse_hold_time.tcp = AAZIntArg( + options=["tcp"], + help="Minimum time in seconds that will pass before a TCP port that was used by a closed pinhole can be reused. Default for TCP is 2 minutes.", + default=120, + fmt=AAZIntArgFormat( + minimum=1, + ), + ) + port_reuse_hold_time.udp = AAZIntArg( + options=["udp"], + help="Minimum time in seconds that will pass before a UDP port that was used by a closed pinhole can be reused. Default for UDP is 1 minute.", + default=60, + fmt=AAZIntArgFormat( + minimum=1, + ), + ) + + address_pool = cls._args_schema.address_pool + address_pool.Element = AAZStrArg( + fmt=AAZStrArgFormat( + pattern="^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$", + ), + ) + + static_address_pool = cls._args_schema.static_address_pool + static_address_pool.Element = AAZStrArg( + fmt=AAZStrArgFormat( + pattern="^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$", + ), + ) + + data_interface = cls._args_schema.data_interface + data_interface.ipv4_address = AAZStrArg( + options=["ipv4-address"], + help="The IPv4 address.", + fmt=AAZStrArgFormat( + pattern="^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$", + ), + ) + data_interface.ipv4_gateway = AAZStrArg( + options=["ipv4-gateway"], + help="The default IPv4 gateway (router).", + fmt=AAZStrArgFormat( + pattern="^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$", + ), + ) + data_interface.ipv4_subnet = AAZStrArg( + options=["ipv4-subnet"], + help="The IPv4 subnet.", + fmt=AAZStrArgFormat( + pattern="^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$", + ), + ) + data_interface.name = AAZStrArg( + options=["name"], + help="The logical name for this interface. This should match one of the interfaces configured on your Azure Stack Edge device.", + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + yield self.AttachedDataNetworksCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class AttachedDataNetworksCreateOrUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200, 201]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/{packetCoreControlPlaneName}/packetCoreDataPlanes/{packetCoreDataPlaneName}/attachedDataNetworks/{attachedDataNetworkName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "attachedDataNetworkName", self.ctx.args.adn_name, + required=True, + ), + **self.serialize_url_param( + "packetCoreControlPlaneName", self.ctx.args.pccp_name, + required=True, + ), + **self.serialize_url_param( + "packetCoreDataPlaneName", self.ctx.args.pcdp_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + typ=AAZObjectType, + typ_kwargs={"flags": {"required": True, "client_flatten": True}} + ) + _builder.set_prop("location", AAZStrType, ".location", typ_kwargs={"flags": {"required": True}}) + _builder.set_prop("properties", AAZObjectType, ".", typ_kwargs={"flags": {"required": True, "client_flatten": True}}) + _builder.set_prop("tags", AAZDictType, ".tags") + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("dnsAddresses", AAZListType, ".dns_addresses", typ_kwargs={"flags": {"required": True}}) + properties.set_prop("naptConfiguration", AAZObjectType, ".napt_configuration") + properties.set_prop("userEquipmentAddressPoolPrefix", AAZListType, ".address_pool") + properties.set_prop("userEquipmentStaticAddressPoolPrefix", AAZListType, ".static_address_pool") + properties.set_prop("userPlaneDataInterface", AAZObjectType, ".data_interface", typ_kwargs={"flags": {"required": True}}) + + dns_addresses = _builder.get(".properties.dnsAddresses") + if dns_addresses is not None: + dns_addresses.set_elements(AAZStrType, ".") + + napt_configuration = _builder.get(".properties.naptConfiguration") + if napt_configuration is not None: + napt_configuration.set_prop("enabled", AAZStrType, ".enabled") + napt_configuration.set_prop("pinholeLimits", AAZIntType, ".pinhole_limits") + napt_configuration.set_prop("pinholeTimeouts", AAZObjectType, ".pinhole_timeouts") + napt_configuration.set_prop("portRange", AAZObjectType, ".port_range") + napt_configuration.set_prop("portReuseHoldTime", AAZObjectType, ".port_reuse_hold_time") + + pinhole_timeouts = _builder.get(".properties.naptConfiguration.pinholeTimeouts") + if pinhole_timeouts is not None: + pinhole_timeouts.set_prop("icmp", AAZIntType, ".icmp") + pinhole_timeouts.set_prop("tcp", AAZIntType, ".tcp") + pinhole_timeouts.set_prop("udp", AAZIntType, ".udp") + + port_range = _builder.get(".properties.naptConfiguration.portRange") + if port_range is not None: + port_range.set_prop("maxPort", AAZIntType, ".max_port") + port_range.set_prop("minPort", AAZIntType, ".min_port") + + port_reuse_hold_time = _builder.get(".properties.naptConfiguration.portReuseHoldTime") + if port_reuse_hold_time is not None: + port_reuse_hold_time.set_prop("tcp", AAZIntType, ".tcp") + port_reuse_hold_time.set_prop("udp", AAZIntType, ".udp") + + user_equipment_address_pool_prefix = _builder.get(".properties.userEquipmentAddressPoolPrefix") + if user_equipment_address_pool_prefix is not None: + user_equipment_address_pool_prefix.set_elements(AAZStrType, ".") + + user_equipment_static_address_pool_prefix = _builder.get(".properties.userEquipmentStaticAddressPoolPrefix") + if user_equipment_static_address_pool_prefix is not None: + user_equipment_static_address_pool_prefix.set_elements(AAZStrType, ".") + + user_plane_data_interface = _builder.get(".properties.userPlaneDataInterface") + if user_plane_data_interface is not None: + user_plane_data_interface.set_prop("ipv4Address", AAZStrType, ".ipv4_address") + user_plane_data_interface.set_prop("ipv4Gateway", AAZStrType, ".ipv4_gateway") + user_plane_data_interface.set_prop("ipv4Subnet", AAZStrType, ".ipv4_subnet") + user_plane_data_interface.set_prop("name", AAZStrType, ".name") + + tags = _builder.get(".tags") + if tags is not None: + tags.set_elements(AAZStrType, ".") + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + + _schema_on_200_201 = cls._schema_on_200_201 + _schema_on_200_201.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.location = AAZStrType( + flags={"required": True}, + ) + _schema_on_200_201.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.properties = AAZObjectType( + flags={"required": True, "client_flatten": True}, + ) + _schema_on_200_201.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200_201.tags = AAZDictType() + _schema_on_200_201.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200_201.properties + properties.dns_addresses = AAZListType( + serialized_name="dnsAddresses", + flags={"required": True}, + ) + properties.napt_configuration = AAZObjectType( + serialized_name="naptConfiguration", + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.user_equipment_address_pool_prefix = AAZListType( + serialized_name="userEquipmentAddressPoolPrefix", + ) + properties.user_equipment_static_address_pool_prefix = AAZListType( + serialized_name="userEquipmentStaticAddressPoolPrefix", + ) + properties.user_plane_data_interface = AAZObjectType( + serialized_name="userPlaneDataInterface", + flags={"required": True}, + ) + + dns_addresses = cls._schema_on_200_201.properties.dns_addresses + dns_addresses.Element = AAZStrType() + + napt_configuration = cls._schema_on_200_201.properties.napt_configuration + napt_configuration.enabled = AAZStrType() + napt_configuration.pinhole_limits = AAZIntType( + serialized_name="pinholeLimits", + ) + napt_configuration.pinhole_timeouts = AAZObjectType( + serialized_name="pinholeTimeouts", + ) + napt_configuration.port_range = AAZObjectType( + serialized_name="portRange", + ) + napt_configuration.port_reuse_hold_time = AAZObjectType( + serialized_name="portReuseHoldTime", + ) + + pinhole_timeouts = cls._schema_on_200_201.properties.napt_configuration.pinhole_timeouts + pinhole_timeouts.icmp = AAZIntType() + pinhole_timeouts.tcp = AAZIntType() + pinhole_timeouts.udp = AAZIntType() + + port_range = cls._schema_on_200_201.properties.napt_configuration.port_range + port_range.max_port = AAZIntType( + serialized_name="maxPort", + ) + port_range.min_port = AAZIntType( + serialized_name="minPort", + ) + + port_reuse_hold_time = cls._schema_on_200_201.properties.napt_configuration.port_reuse_hold_time + port_reuse_hold_time.tcp = AAZIntType() + port_reuse_hold_time.udp = AAZIntType() + + user_equipment_address_pool_prefix = cls._schema_on_200_201.properties.user_equipment_address_pool_prefix + user_equipment_address_pool_prefix.Element = AAZStrType() + + user_equipment_static_address_pool_prefix = cls._schema_on_200_201.properties.user_equipment_static_address_pool_prefix + user_equipment_static_address_pool_prefix.Element = AAZStrType() + + user_plane_data_interface = cls._schema_on_200_201.properties.user_plane_data_interface + user_plane_data_interface.ipv4_address = AAZStrType( + serialized_name="ipv4Address", + ) + user_plane_data_interface.ipv4_gateway = AAZStrType( + serialized_name="ipv4Gateway", + ) + user_plane_data_interface.ipv4_subnet = AAZStrType( + serialized_name="ipv4Subnet", + ) + user_plane_data_interface.name = AAZStrType() + + system_data = cls._schema_on_200_201.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200_201.tags + tags.Element = AAZStrType() + + return cls._schema_on_200_201 + + +class _CreateHelper: + """Helper class for Create""" + + +__all__ = ["Create"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/attached_data_network/_delete.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/attached_data_network/_delete.py new file mode 100644 index 00000000000..0ecaed1c6d8 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/attached_data_network/_delete.py @@ -0,0 +1,195 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network attached-data-network delete", + confirmation="Are you sure you want to perform this operation?", +) +class Delete(AAZCommand): + """Delete the specified attached data network. + + :example: Delete attached-data-network + az mobile-network attached-data-network delete -n data-network-name --pccp-name pccp-name --pcdp-name pcdp-name -g rg -y + """ + + _aaz_info = { + "version": "2022-11-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/packetcorecontrolplanes/{}/packetcoredataplanes/{}/attacheddatanetworks/{}", "2022-11-01"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, None) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.adn_name = AAZStrArg( + options=["-n", "--name", "--adn-name"], + help="The name of the attached data network.", + required=True, + id_part="child_name_2", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])*(\.[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])*)*$", + max_length=64, + ), + ) + _args_schema.pccp_name = AAZStrArg( + options=["--pccp-name"], + help="The name of the packet core control plane.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.pcdp_name = AAZStrArg( + options=["--pcdp-name"], + help="The name of the packet core data plane.", + required=True, + id_part="child_name_1", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + yield self.AttachedDataNetworksDelete(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + class AttachedDataNetworksDelete(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [204]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_204, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/{packetCoreControlPlaneName}/packetCoreDataPlanes/{packetCoreDataPlaneName}/attachedDataNetworks/{attachedDataNetworkName}", + **self.url_parameters + ) + + @property + def method(self): + return "DELETE" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "attachedDataNetworkName", self.ctx.args.adn_name, + required=True, + ), + **self.serialize_url_param( + "packetCoreControlPlaneName", self.ctx.args.pccp_name, + required=True, + ), + **self.serialize_url_param( + "packetCoreDataPlaneName", self.ctx.args.pcdp_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + def on_200(self, session): + pass + + def on_204(self, session): + pass + + +class _DeleteHelper: + """Helper class for Delete""" + + +__all__ = ["Delete"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/attached_data_network/_list.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/attached_data_network/_list.py new file mode 100644 index 00000000000..1911aed7135 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/attached_data_network/_list.py @@ -0,0 +1,309 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network attached-data-network list", +) +class List(AAZCommand): + """List all the attached data networks associated with a packet core data plane. + + :example: List attached-data-network by resource group + az mobile-network attached-data-network list -g rg --pccp-name pccp-name --pcdp-name pcdp-name + """ + + _aaz_info = { + "version": "2022-11-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/packetcorecontrolplanes/{}/packetcoredataplanes/{}/attacheddatanetworks", "2022-11-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_paging(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.pccp_name = AAZStrArg( + options=["--pccp-name"], + help="The name of the packet core control plane.", + required=True, + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.pcdp_name = AAZStrArg( + options=["--pcdp-name"], + help="The name of the packet core data plane.", + required=True, + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.AttachedDataNetworksListByPacketCoreDataPlane(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) + next_link = self.deserialize_output(self.ctx.vars.instance.next_link) + return result, next_link + + class AttachedDataNetworksListByPacketCoreDataPlane(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/{packetCoreControlPlaneName}/packetCoreDataPlanes/{packetCoreDataPlaneName}/attachedDataNetworks", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "packetCoreControlPlaneName", self.ctx.args.pccp_name, + required=True, + ), + **self.serialize_url_param( + "packetCoreDataPlaneName", self.ctx.args.pcdp_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.next_link = AAZStrType( + serialized_name="nextLink", + flags={"read_only": True}, + ) + _schema_on_200.value = AAZListType() + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.location = AAZStrType( + flags={"required": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType( + flags={"required": True, "client_flatten": True}, + ) + _element.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _element.tags = AAZDictType() + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.dns_addresses = AAZListType( + serialized_name="dnsAddresses", + flags={"required": True}, + ) + properties.napt_configuration = AAZObjectType( + serialized_name="naptConfiguration", + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.user_equipment_address_pool_prefix = AAZListType( + serialized_name="userEquipmentAddressPoolPrefix", + ) + properties.user_equipment_static_address_pool_prefix = AAZListType( + serialized_name="userEquipmentStaticAddressPoolPrefix", + ) + properties.user_plane_data_interface = AAZObjectType( + serialized_name="userPlaneDataInterface", + flags={"required": True}, + ) + + dns_addresses = cls._schema_on_200.value.Element.properties.dns_addresses + dns_addresses.Element = AAZStrType() + + napt_configuration = cls._schema_on_200.value.Element.properties.napt_configuration + napt_configuration.enabled = AAZStrType() + napt_configuration.pinhole_limits = AAZIntType( + serialized_name="pinholeLimits", + ) + napt_configuration.pinhole_timeouts = AAZObjectType( + serialized_name="pinholeTimeouts", + ) + napt_configuration.port_range = AAZObjectType( + serialized_name="portRange", + ) + napt_configuration.port_reuse_hold_time = AAZObjectType( + serialized_name="portReuseHoldTime", + ) + + pinhole_timeouts = cls._schema_on_200.value.Element.properties.napt_configuration.pinhole_timeouts + pinhole_timeouts.icmp = AAZIntType() + pinhole_timeouts.tcp = AAZIntType() + pinhole_timeouts.udp = AAZIntType() + + port_range = cls._schema_on_200.value.Element.properties.napt_configuration.port_range + port_range.max_port = AAZIntType( + serialized_name="maxPort", + ) + port_range.min_port = AAZIntType( + serialized_name="minPort", + ) + + port_reuse_hold_time = cls._schema_on_200.value.Element.properties.napt_configuration.port_reuse_hold_time + port_reuse_hold_time.tcp = AAZIntType() + port_reuse_hold_time.udp = AAZIntType() + + user_equipment_address_pool_prefix = cls._schema_on_200.value.Element.properties.user_equipment_address_pool_prefix + user_equipment_address_pool_prefix.Element = AAZStrType() + + user_equipment_static_address_pool_prefix = cls._schema_on_200.value.Element.properties.user_equipment_static_address_pool_prefix + user_equipment_static_address_pool_prefix.Element = AAZStrType() + + user_plane_data_interface = cls._schema_on_200.value.Element.properties.user_plane_data_interface + user_plane_data_interface.ipv4_address = AAZStrType( + serialized_name="ipv4Address", + ) + user_plane_data_interface.ipv4_gateway = AAZStrType( + serialized_name="ipv4Gateway", + ) + user_plane_data_interface.ipv4_subnet = AAZStrType( + serialized_name="ipv4Subnet", + ) + user_plane_data_interface.name = AAZStrType() + + system_data = cls._schema_on_200.value.Element.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.value.Element.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _ListHelper: + """Helper class for List""" + + +__all__ = ["List"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/attached_data_network/_show.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/attached_data_network/_show.py new file mode 100644 index 00000000000..e4f96584500 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/attached_data_network/_show.py @@ -0,0 +1,315 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network attached-data-network show", +) +class Show(AAZCommand): + """Get information about the specified attached data network. + + :example: Show attached-data-network + az mobile-network attached-data-network show -n data-network-name --pccp-name pccp-name --pcdp-name pcdp-name -g rg + """ + + _aaz_info = { + "version": "2022-11-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/packetcorecontrolplanes/{}/packetcoredataplanes/{}/attacheddatanetworks/{}", "2022-11-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.adn_name = AAZStrArg( + options=["-n", "--name", "--adn-name"], + help="The name of the attached data network.", + required=True, + id_part="child_name_2", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])*(\.[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])*)*$", + max_length=64, + ), + ) + _args_schema.pccp_name = AAZStrArg( + options=["--pccp-name"], + help="The name of the packet core control plane.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.pcdp_name = AAZStrArg( + options=["--pcdp-name"], + help="The name of the packet core data plane.", + required=True, + id_part="child_name_1", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.AttachedDataNetworksGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class AttachedDataNetworksGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/{packetCoreControlPlaneName}/packetCoreDataPlanes/{packetCoreDataPlaneName}/attachedDataNetworks/{attachedDataNetworkName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "attachedDataNetworkName", self.ctx.args.adn_name, + required=True, + ), + **self.serialize_url_param( + "packetCoreControlPlaneName", self.ctx.args.pccp_name, + required=True, + ), + **self.serialize_url_param( + "packetCoreDataPlaneName", self.ctx.args.pcdp_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.location = AAZStrType( + flags={"required": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType( + flags={"required": True, "client_flatten": True}, + ) + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.dns_addresses = AAZListType( + serialized_name="dnsAddresses", + flags={"required": True}, + ) + properties.napt_configuration = AAZObjectType( + serialized_name="naptConfiguration", + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.user_equipment_address_pool_prefix = AAZListType( + serialized_name="userEquipmentAddressPoolPrefix", + ) + properties.user_equipment_static_address_pool_prefix = AAZListType( + serialized_name="userEquipmentStaticAddressPoolPrefix", + ) + properties.user_plane_data_interface = AAZObjectType( + serialized_name="userPlaneDataInterface", + flags={"required": True}, + ) + + dns_addresses = cls._schema_on_200.properties.dns_addresses + dns_addresses.Element = AAZStrType() + + napt_configuration = cls._schema_on_200.properties.napt_configuration + napt_configuration.enabled = AAZStrType() + napt_configuration.pinhole_limits = AAZIntType( + serialized_name="pinholeLimits", + ) + napt_configuration.pinhole_timeouts = AAZObjectType( + serialized_name="pinholeTimeouts", + ) + napt_configuration.port_range = AAZObjectType( + serialized_name="portRange", + ) + napt_configuration.port_reuse_hold_time = AAZObjectType( + serialized_name="portReuseHoldTime", + ) + + pinhole_timeouts = cls._schema_on_200.properties.napt_configuration.pinhole_timeouts + pinhole_timeouts.icmp = AAZIntType() + pinhole_timeouts.tcp = AAZIntType() + pinhole_timeouts.udp = AAZIntType() + + port_range = cls._schema_on_200.properties.napt_configuration.port_range + port_range.max_port = AAZIntType( + serialized_name="maxPort", + ) + port_range.min_port = AAZIntType( + serialized_name="minPort", + ) + + port_reuse_hold_time = cls._schema_on_200.properties.napt_configuration.port_reuse_hold_time + port_reuse_hold_time.tcp = AAZIntType() + port_reuse_hold_time.udp = AAZIntType() + + user_equipment_address_pool_prefix = cls._schema_on_200.properties.user_equipment_address_pool_prefix + user_equipment_address_pool_prefix.Element = AAZStrType() + + user_equipment_static_address_pool_prefix = cls._schema_on_200.properties.user_equipment_static_address_pool_prefix + user_equipment_static_address_pool_prefix.Element = AAZStrType() + + user_plane_data_interface = cls._schema_on_200.properties.user_plane_data_interface + user_plane_data_interface.ipv4_address = AAZStrType( + serialized_name="ipv4Address", + ) + user_plane_data_interface.ipv4_gateway = AAZStrType( + serialized_name="ipv4Gateway", + ) + user_plane_data_interface.ipv4_subnet = AAZStrType( + serialized_name="ipv4Subnet", + ) + user_plane_data_interface.name = AAZStrType() + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _ShowHelper: + """Helper class for Show""" + + +__all__ = ["Show"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/attached_data_network/_update.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/attached_data_network/_update.py new file mode 100644 index 00000000000..4a6044f66a9 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/attached_data_network/_update.py @@ -0,0 +1,761 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network attached-data-network update", +) +class Update(AAZCommand): + """Update an attached data network. + + :example: Update attached-data-network tags + az mobile-network attached-data-network update -n data_network-name -g rg --pccp-name pccp-name --pcdp-name pcdp-name --tags "{tag:test,tag2:test2}" + """ + + _aaz_info = { + "version": "2022-11-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/packetcorecontrolplanes/{}/packetcoredataplanes/{}/attacheddatanetworks/{}", "2022-11-01"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + AZ_SUPPORT_GENERIC_UPDATE = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.adn_name = AAZStrArg( + options=["-n", "--name", "--adn-name"], + help="The name of the attached data network.", + required=True, + id_part="child_name_2", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])*(\.[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])*)*$", + max_length=64, + ), + ) + _args_schema.pccp_name = AAZStrArg( + options=["--pccp-name"], + help="The name of the packet core control plane.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.pcdp_name = AAZStrArg( + options=["--pcdp-name"], + help="The name of the packet core data plane.", + required=True, + id_part="child_name_1", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + + # define Arg Group "Parameters" + + _args_schema = cls._args_schema + _args_schema.tags = AAZDictArg( + options=["--tags"], + arg_group="Parameters", + help="Resource tags.", + nullable=True, + ) + + tags = cls._args_schema.tags + tags.Element = AAZStrArg( + nullable=True, + ) + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.dns_addresses = AAZListArg( + options=["--dns-addresses"], + arg_group="Properties", + help="The DNS servers to signal to UEs to use for this attached data network.", + fmt=AAZListArgFormat( + unique=True, + ), + ) + _args_schema.napt_configuration = AAZObjectArg( + options=["--napt-configuration"], + arg_group="Properties", + help="The network address and port translation (NAPT) configuration. If this is not specified, the attached data network will use a default NAPT configuration with NAPT enabled.", + nullable=True, + ) + _args_schema.address_pool = AAZListArg( + options=["--address-pool"], + arg_group="Properties", + help="The user equipment (UE) address pool prefixes for the attached data network from which the packet core instance will dynamically assign IP addresses to UEs. The packet core instance assigns an IP address to a UE when the UE sets up a PDU session. You must define at least one of userEquipmentAddressPoolPrefix and userEquipmentStaticAddressPoolPrefix. If you define both, they must be of the same size.", + nullable=True, + fmt=AAZListArgFormat( + unique=True, + ), + ) + _args_schema.static_address_pool = AAZListArg( + options=["--static-address-pool"], + arg_group="Properties", + help="The user equipment (UE) address pool prefixes for the attached data network from which the packet core instance will assign static IP addresses to UEs. The packet core instance assigns an IP address to a UE when the UE sets up a PDU session. The static IP address for a specific UE is set in StaticIPConfiguration on the corresponding SIM resource. At least one of userEquipmentAddressPoolPrefix and userEquipmentStaticAddressPoolPrefix must be defined. If both are defined, they must be of the same size.", + nullable=True, + fmt=AAZListArgFormat( + unique=True, + ), + ) + _args_schema.data_interface = AAZObjectArg( + options=["--data-interface"], + arg_group="Properties", + help="The user plane interface on the data network. For 5G networks, this is the N6 interface. For 4G networks, this is the SGi interface.", + ) + + dns_addresses = cls._args_schema.dns_addresses + dns_addresses.Element = AAZStrArg( + nullable=True, + fmt=AAZStrArgFormat( + pattern="^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$", + ), + ) + + napt_configuration = cls._args_schema.napt_configuration + napt_configuration.enabled = AAZStrArg( + options=["enabled"], + help="Whether NAPT is enabled for connections to this attached data network.", + nullable=True, + enum={"Disabled": "Disabled", "Enabled": "Enabled"}, + ) + napt_configuration.pinhole_limits = AAZIntArg( + options=["pinhole-limits"], + help="Maximum number of UDP and TCP pinholes that can be open simultaneously on the core interface. For 5G networks, this is the N6 interface. For 4G networks, this is the SGi interface.", + nullable=True, + fmt=AAZIntArgFormat( + maximum=65536, + minimum=1, + ), + ) + napt_configuration.pinhole_timeouts = AAZObjectArg( + options=["pinhole-timeouts"], + help="Expiry times of inactive NAPT pinholes, in seconds. All timers must be at least 1 second.", + nullable=True, + ) + napt_configuration.port_range = AAZObjectArg( + options=["port-range"], + help="Range of port numbers to use as translated ports on each translated address. If not specified and NAPT is enabled, this range defaults to 1,024 - 49,999. (Ports under 1,024 should not be used because these are special purpose ports reserved by IANA. Ports 50,000 and above are reserved for non-NAPT use.)", + nullable=True, + ) + napt_configuration.port_reuse_hold_time = AAZObjectArg( + options=["port-reuse-hold-time"], + help="The minimum time (in seconds) that will pass before a port that was used by a closed pinhole can be recycled for use by another pinhole. All hold times must be minimum 1 second.", + nullable=True, + ) + + pinhole_timeouts = cls._args_schema.napt_configuration.pinhole_timeouts + pinhole_timeouts.icmp = AAZIntArg( + options=["icmp"], + help="Pinhole timeout for ICMP pinholes in seconds. Default for ICMP Echo is 60 seconds, as per RFC 5508 section 3.2.", + nullable=True, + fmt=AAZIntArgFormat( + minimum=1, + ), + ) + pinhole_timeouts.tcp = AAZIntArg( + options=["tcp"], + help="Pinhole timeout for TCP pinholes in seconds. Default for TCP is 2 hours 4 minutes, as per RFC 5382 section 5.", + nullable=True, + fmt=AAZIntArgFormat( + minimum=1, + ), + ) + pinhole_timeouts.udp = AAZIntArg( + options=["udp"], + help="Pinhole timeout for UDP pinholes in seconds. Default for UDP is 5 minutes, as per RFC 4787 section 4.3.", + nullable=True, + fmt=AAZIntArgFormat( + minimum=1, + ), + ) + + port_range = cls._args_schema.napt_configuration.port_range + port_range.max_port = AAZIntArg( + options=["max-port"], + help="The maximum port number", + nullable=True, + fmt=AAZIntArgFormat( + maximum=65535, + minimum=1024, + ), + ) + port_range.min_port = AAZIntArg( + options=["min-port"], + help="The minimum port number", + nullable=True, + fmt=AAZIntArgFormat( + maximum=65535, + minimum=1024, + ), + ) + + port_reuse_hold_time = cls._args_schema.napt_configuration.port_reuse_hold_time + port_reuse_hold_time.tcp = AAZIntArg( + options=["tcp"], + help="Minimum time in seconds that will pass before a TCP port that was used by a closed pinhole can be reused. Default for TCP is 2 minutes.", + nullable=True, + fmt=AAZIntArgFormat( + minimum=1, + ), + ) + port_reuse_hold_time.udp = AAZIntArg( + options=["udp"], + help="Minimum time in seconds that will pass before a UDP port that was used by a closed pinhole can be reused. Default for UDP is 1 minute.", + nullable=True, + fmt=AAZIntArgFormat( + minimum=1, + ), + ) + + address_pool = cls._args_schema.address_pool + address_pool.Element = AAZStrArg( + nullable=True, + fmt=AAZStrArgFormat( + pattern="^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$", + ), + ) + + static_address_pool = cls._args_schema.static_address_pool + static_address_pool.Element = AAZStrArg( + nullable=True, + fmt=AAZStrArgFormat( + pattern="^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$", + ), + ) + + data_interface = cls._args_schema.data_interface + data_interface.ipv4_address = AAZStrArg( + options=["ipv4-address"], + help="The IPv4 address.", + nullable=True, + fmt=AAZStrArgFormat( + pattern="^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$", + ), + ) + data_interface.ipv4_gateway = AAZStrArg( + options=["ipv4-gateway"], + help="The default IPv4 gateway (router).", + nullable=True, + fmt=AAZStrArgFormat( + pattern="^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$", + ), + ) + data_interface.ipv4_subnet = AAZStrArg( + options=["ipv4-subnet"], + help="The IPv4 subnet.", + nullable=True, + fmt=AAZStrArgFormat( + pattern="^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$", + ), + ) + data_interface.name = AAZStrArg( + options=["name"], + help="The logical name for this interface. This should match one of the interfaces configured on your Azure Stack Edge device.", + nullable=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.AttachedDataNetworksGet(ctx=self.ctx)() + self.pre_instance_update(self.ctx.vars.instance) + self.InstanceUpdateByJson(ctx=self.ctx)() + self.InstanceUpdateByGeneric(ctx=self.ctx)() + self.post_instance_update(self.ctx.vars.instance) + yield self.AttachedDataNetworksCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + @register_callback + def pre_instance_update(self, instance): + pass + + @register_callback + def post_instance_update(self, instance): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class AttachedDataNetworksGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/{packetCoreControlPlaneName}/packetCoreDataPlanes/{packetCoreDataPlaneName}/attachedDataNetworks/{attachedDataNetworkName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "attachedDataNetworkName", self.ctx.args.adn_name, + required=True, + ), + **self.serialize_url_param( + "packetCoreControlPlaneName", self.ctx.args.pccp_name, + required=True, + ), + **self.serialize_url_param( + "packetCoreDataPlaneName", self.ctx.args.pcdp_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + _UpdateHelper._build_schema_attached_data_network_read(cls._schema_on_200) + + return cls._schema_on_200 + + class AttachedDataNetworksCreateOrUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200, 201]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/{packetCoreControlPlaneName}/packetCoreDataPlanes/{packetCoreDataPlaneName}/attachedDataNetworks/{attachedDataNetworkName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "attachedDataNetworkName", self.ctx.args.adn_name, + required=True, + ), + **self.serialize_url_param( + "packetCoreControlPlaneName", self.ctx.args.pccp_name, + required=True, + ), + **self.serialize_url_param( + "packetCoreDataPlaneName", self.ctx.args.pcdp_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + value=self.ctx.vars.instance, + ) + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + _UpdateHelper._build_schema_attached_data_network_read(cls._schema_on_200_201) + + return cls._schema_on_200_201 + + class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): + + def __call__(self, *args, **kwargs): + self._update_instance(self.ctx.vars.instance) + + def _update_instance(self, instance): + _instance_value, _builder = self.new_content_builder( + self.ctx.args, + value=instance, + typ=AAZObjectType + ) + _builder.set_prop("properties", AAZObjectType, ".", typ_kwargs={"flags": {"required": True, "client_flatten": True}}) + _builder.set_prop("tags", AAZDictType, ".tags") + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("dnsAddresses", AAZListType, ".dns_addresses", typ_kwargs={"flags": {"required": True}}) + properties.set_prop("naptConfiguration", AAZObjectType, ".napt_configuration") + properties.set_prop("userEquipmentAddressPoolPrefix", AAZListType, ".address_pool") + properties.set_prop("userEquipmentStaticAddressPoolPrefix", AAZListType, ".static_address_pool") + properties.set_prop("userPlaneDataInterface", AAZObjectType, ".data_interface", typ_kwargs={"flags": {"required": True}}) + + dns_addresses = _builder.get(".properties.dnsAddresses") + if dns_addresses is not None: + dns_addresses.set_elements(AAZStrType, ".") + + napt_configuration = _builder.get(".properties.naptConfiguration") + if napt_configuration is not None: + napt_configuration.set_prop("enabled", AAZStrType, ".enabled") + napt_configuration.set_prop("pinholeLimits", AAZIntType, ".pinhole_limits") + napt_configuration.set_prop("pinholeTimeouts", AAZObjectType, ".pinhole_timeouts") + napt_configuration.set_prop("portRange", AAZObjectType, ".port_range") + napt_configuration.set_prop("portReuseHoldTime", AAZObjectType, ".port_reuse_hold_time") + + pinhole_timeouts = _builder.get(".properties.naptConfiguration.pinholeTimeouts") + if pinhole_timeouts is not None: + pinhole_timeouts.set_prop("icmp", AAZIntType, ".icmp") + pinhole_timeouts.set_prop("tcp", AAZIntType, ".tcp") + pinhole_timeouts.set_prop("udp", AAZIntType, ".udp") + + port_range = _builder.get(".properties.naptConfiguration.portRange") + if port_range is not None: + port_range.set_prop("maxPort", AAZIntType, ".max_port") + port_range.set_prop("minPort", AAZIntType, ".min_port") + + port_reuse_hold_time = _builder.get(".properties.naptConfiguration.portReuseHoldTime") + if port_reuse_hold_time is not None: + port_reuse_hold_time.set_prop("tcp", AAZIntType, ".tcp") + port_reuse_hold_time.set_prop("udp", AAZIntType, ".udp") + + user_equipment_address_pool_prefix = _builder.get(".properties.userEquipmentAddressPoolPrefix") + if user_equipment_address_pool_prefix is not None: + user_equipment_address_pool_prefix.set_elements(AAZStrType, ".") + + user_equipment_static_address_pool_prefix = _builder.get(".properties.userEquipmentStaticAddressPoolPrefix") + if user_equipment_static_address_pool_prefix is not None: + user_equipment_static_address_pool_prefix.set_elements(AAZStrType, ".") + + user_plane_data_interface = _builder.get(".properties.userPlaneDataInterface") + if user_plane_data_interface is not None: + user_plane_data_interface.set_prop("ipv4Address", AAZStrType, ".ipv4_address") + user_plane_data_interface.set_prop("ipv4Gateway", AAZStrType, ".ipv4_gateway") + user_plane_data_interface.set_prop("ipv4Subnet", AAZStrType, ".ipv4_subnet") + user_plane_data_interface.set_prop("name", AAZStrType, ".name") + + tags = _builder.get(".tags") + if tags is not None: + tags.set_elements(AAZStrType, ".") + + return _instance_value + + class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): + + def __call__(self, *args, **kwargs): + self._update_instance_by_generic( + self.ctx.vars.instance, + self.ctx.generic_update_args + ) + + +class _UpdateHelper: + """Helper class for Update""" + + _schema_attached_data_network_read = None + + @classmethod + def _build_schema_attached_data_network_read(cls, _schema): + if cls._schema_attached_data_network_read is not None: + _schema.id = cls._schema_attached_data_network_read.id + _schema.location = cls._schema_attached_data_network_read.location + _schema.name = cls._schema_attached_data_network_read.name + _schema.properties = cls._schema_attached_data_network_read.properties + _schema.system_data = cls._schema_attached_data_network_read.system_data + _schema.tags = cls._schema_attached_data_network_read.tags + _schema.type = cls._schema_attached_data_network_read.type + return + + cls._schema_attached_data_network_read = _schema_attached_data_network_read = AAZObjectType() + + attached_data_network_read = _schema_attached_data_network_read + attached_data_network_read.id = AAZStrType( + flags={"read_only": True}, + ) + attached_data_network_read.location = AAZStrType( + flags={"required": True}, + ) + attached_data_network_read.name = AAZStrType( + flags={"read_only": True}, + ) + attached_data_network_read.properties = AAZObjectType( + flags={"required": True, "client_flatten": True}, + ) + attached_data_network_read.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + attached_data_network_read.tags = AAZDictType() + attached_data_network_read.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = _schema_attached_data_network_read.properties + properties.dns_addresses = AAZListType( + serialized_name="dnsAddresses", + flags={"required": True}, + ) + properties.napt_configuration = AAZObjectType( + serialized_name="naptConfiguration", + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.user_equipment_address_pool_prefix = AAZListType( + serialized_name="userEquipmentAddressPoolPrefix", + ) + properties.user_equipment_static_address_pool_prefix = AAZListType( + serialized_name="userEquipmentStaticAddressPoolPrefix", + ) + properties.user_plane_data_interface = AAZObjectType( + serialized_name="userPlaneDataInterface", + flags={"required": True}, + ) + + dns_addresses = _schema_attached_data_network_read.properties.dns_addresses + dns_addresses.Element = AAZStrType() + + napt_configuration = _schema_attached_data_network_read.properties.napt_configuration + napt_configuration.enabled = AAZStrType() + napt_configuration.pinhole_limits = AAZIntType( + serialized_name="pinholeLimits", + ) + napt_configuration.pinhole_timeouts = AAZObjectType( + serialized_name="pinholeTimeouts", + ) + napt_configuration.port_range = AAZObjectType( + serialized_name="portRange", + ) + napt_configuration.port_reuse_hold_time = AAZObjectType( + serialized_name="portReuseHoldTime", + ) + + pinhole_timeouts = _schema_attached_data_network_read.properties.napt_configuration.pinhole_timeouts + pinhole_timeouts.icmp = AAZIntType() + pinhole_timeouts.tcp = AAZIntType() + pinhole_timeouts.udp = AAZIntType() + + port_range = _schema_attached_data_network_read.properties.napt_configuration.port_range + port_range.max_port = AAZIntType( + serialized_name="maxPort", + ) + port_range.min_port = AAZIntType( + serialized_name="minPort", + ) + + port_reuse_hold_time = _schema_attached_data_network_read.properties.napt_configuration.port_reuse_hold_time + port_reuse_hold_time.tcp = AAZIntType() + port_reuse_hold_time.udp = AAZIntType() + + user_equipment_address_pool_prefix = _schema_attached_data_network_read.properties.user_equipment_address_pool_prefix + user_equipment_address_pool_prefix.Element = AAZStrType() + + user_equipment_static_address_pool_prefix = _schema_attached_data_network_read.properties.user_equipment_static_address_pool_prefix + user_equipment_static_address_pool_prefix.Element = AAZStrType() + + user_plane_data_interface = _schema_attached_data_network_read.properties.user_plane_data_interface + user_plane_data_interface.ipv4_address = AAZStrType( + serialized_name="ipv4Address", + ) + user_plane_data_interface.ipv4_gateway = AAZStrType( + serialized_name="ipv4Gateway", + ) + user_plane_data_interface.ipv4_subnet = AAZStrType( + serialized_name="ipv4Subnet", + ) + user_plane_data_interface.name = AAZStrType() + + system_data = _schema_attached_data_network_read.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = _schema_attached_data_network_read.tags + tags.Element = AAZStrType() + + _schema.id = cls._schema_attached_data_network_read.id + _schema.location = cls._schema_attached_data_network_read.location + _schema.name = cls._schema_attached_data_network_read.name + _schema.properties = cls._schema_attached_data_network_read.properties + _schema.system_data = cls._schema_attached_data_network_read.system_data + _schema.tags = cls._schema_attached_data_network_read.tags + _schema.type = cls._schema_attached_data_network_read.type + + +__all__ = ["Update"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/attached_data_network/_wait.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/attached_data_network/_wait.py new file mode 100644 index 00000000000..d649ebe5e30 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/attached_data_network/_wait.py @@ -0,0 +1,311 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network attached-data-network wait", +) +class Wait(AAZWaitCommand): + """Place the CLI in a waiting state until a condition is met. + """ + + _aaz_info = { + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/packetcorecontrolplanes/{}/packetcoredataplanes/{}/attacheddatanetworks/{}", "2022-11-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.adn_name = AAZStrArg( + options=["-n", "--name", "--adn-name"], + help="The name of the attached data network.", + required=True, + id_part="child_name_2", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])*(\.[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])*)*$", + max_length=64, + ), + ) + _args_schema.pccp_name = AAZStrArg( + options=["--pccp-name"], + help="The name of the packet core control plane.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.pcdp_name = AAZStrArg( + options=["--pcdp-name"], + help="The name of the packet core data plane.", + required=True, + id_part="child_name_1", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.AttachedDataNetworksGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) + return result + + class AttachedDataNetworksGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/{packetCoreControlPlaneName}/packetCoreDataPlanes/{packetCoreDataPlaneName}/attachedDataNetworks/{attachedDataNetworkName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "attachedDataNetworkName", self.ctx.args.adn_name, + required=True, + ), + **self.serialize_url_param( + "packetCoreControlPlaneName", self.ctx.args.pccp_name, + required=True, + ), + **self.serialize_url_param( + "packetCoreDataPlaneName", self.ctx.args.pcdp_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.location = AAZStrType( + flags={"required": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType( + flags={"required": True, "client_flatten": True}, + ) + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.dns_addresses = AAZListType( + serialized_name="dnsAddresses", + flags={"required": True}, + ) + properties.napt_configuration = AAZObjectType( + serialized_name="naptConfiguration", + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.user_equipment_address_pool_prefix = AAZListType( + serialized_name="userEquipmentAddressPoolPrefix", + ) + properties.user_equipment_static_address_pool_prefix = AAZListType( + serialized_name="userEquipmentStaticAddressPoolPrefix", + ) + properties.user_plane_data_interface = AAZObjectType( + serialized_name="userPlaneDataInterface", + flags={"required": True}, + ) + + dns_addresses = cls._schema_on_200.properties.dns_addresses + dns_addresses.Element = AAZStrType() + + napt_configuration = cls._schema_on_200.properties.napt_configuration + napt_configuration.enabled = AAZStrType() + napt_configuration.pinhole_limits = AAZIntType( + serialized_name="pinholeLimits", + ) + napt_configuration.pinhole_timeouts = AAZObjectType( + serialized_name="pinholeTimeouts", + ) + napt_configuration.port_range = AAZObjectType( + serialized_name="portRange", + ) + napt_configuration.port_reuse_hold_time = AAZObjectType( + serialized_name="portReuseHoldTime", + ) + + pinhole_timeouts = cls._schema_on_200.properties.napt_configuration.pinhole_timeouts + pinhole_timeouts.icmp = AAZIntType() + pinhole_timeouts.tcp = AAZIntType() + pinhole_timeouts.udp = AAZIntType() + + port_range = cls._schema_on_200.properties.napt_configuration.port_range + port_range.max_port = AAZIntType( + serialized_name="maxPort", + ) + port_range.min_port = AAZIntType( + serialized_name="minPort", + ) + + port_reuse_hold_time = cls._schema_on_200.properties.napt_configuration.port_reuse_hold_time + port_reuse_hold_time.tcp = AAZIntType() + port_reuse_hold_time.udp = AAZIntType() + + user_equipment_address_pool_prefix = cls._schema_on_200.properties.user_equipment_address_pool_prefix + user_equipment_address_pool_prefix.Element = AAZStrType() + + user_equipment_static_address_pool_prefix = cls._schema_on_200.properties.user_equipment_static_address_pool_prefix + user_equipment_static_address_pool_prefix.Element = AAZStrType() + + user_plane_data_interface = cls._schema_on_200.properties.user_plane_data_interface + user_plane_data_interface.ipv4_address = AAZStrType( + serialized_name="ipv4Address", + ) + user_plane_data_interface.ipv4_gateway = AAZStrType( + serialized_name="ipv4Gateway", + ) + user_plane_data_interface.ipv4_subnet = AAZStrType( + serialized_name="ipv4Subnet", + ) + user_plane_data_interface.name = AAZStrType() + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _WaitHelper: + """Helper class for Wait""" + + +__all__ = ["Wait"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/data_network/__cmd_group.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/data_network/__cmd_group.py new file mode 100644 index 00000000000..89e3690a0c5 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/data_network/__cmd_group.py @@ -0,0 +1,23 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command_group( + "mobile-network data-network", +) +class __CMDGroup(AAZCommandGroup): + """Manage data network + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/data_network/__init__.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/data_network/__init__.py new file mode 100644 index 00000000000..db73033039b --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/data_network/__init__.py @@ -0,0 +1,17 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * +from ._create import * +from ._delete import * +from ._list import * +from ._show import * +from ._update import * +from ._wait import * diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/data_network/_create.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/data_network/_create.py new file mode 100644 index 00000000000..81ee2d5abb2 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/data_network/_create.py @@ -0,0 +1,300 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network data-network create", +) +class Create(AAZCommand): + """Create a data network. + + :example: Create data-network + az mobile-network data-network create -n data-network-name -g rg --mobile-network-name mobile-network-name + """ + + _aaz_info = { + "version": "2022-11-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/mobilenetworks/{}/datanetworks/{}", "2022-11-01"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.data_network_name = AAZStrArg( + options=["-n", "--name", "--data-network-name"], + help="The name of the data network.", + required=True, + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])*(\.[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])*)*$", + max_length=64, + ), + ) + _args_schema.mobile_network_name = AAZStrArg( + options=["--mobile-network-name"], + help="The name of the mobile network.", + required=True, + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + + # define Arg Group "Parameters" + + _args_schema = cls._args_schema + _args_schema.location = AAZResourceLocationArg( + arg_group="Parameters", + help="The geo-location where the resource lives", + required=True, + fmt=AAZResourceLocationArgFormat( + resource_group_arg="resource_group", + ), + ) + _args_schema.tags = AAZDictArg( + options=["--tags"], + arg_group="Parameters", + help="Resource tags.", + ) + + tags = cls._args_schema.tags + tags.Element = AAZStrArg() + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.description = AAZStrArg( + options=["--description"], + arg_group="Properties", + help="An optional description for this data network.", + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + yield self.DataNetworksCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class DataNetworksCreateOrUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200, 201]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/mobileNetworks/{mobileNetworkName}/dataNetworks/{dataNetworkName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "dataNetworkName", self.ctx.args.data_network_name, + required=True, + ), + **self.serialize_url_param( + "mobileNetworkName", self.ctx.args.mobile_network_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + typ=AAZObjectType, + typ_kwargs={"flags": {"required": True, "client_flatten": True}} + ) + _builder.set_prop("location", AAZStrType, ".location", typ_kwargs={"flags": {"required": True}}) + _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) + _builder.set_prop("tags", AAZDictType, ".tags") + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("description", AAZStrType, ".description") + + tags = _builder.get(".tags") + if tags is not None: + tags.set_elements(AAZStrType, ".") + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + + _schema_on_200_201 = cls._schema_on_200_201 + _schema_on_200_201.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.location = AAZStrType( + flags={"required": True}, + ) + _schema_on_200_201.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _schema_on_200_201.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200_201.tags = AAZDictType() + _schema_on_200_201.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200_201.properties + properties.description = AAZStrType() + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + system_data = cls._schema_on_200_201.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200_201.tags + tags.Element = AAZStrType() + + return cls._schema_on_200_201 + + +class _CreateHelper: + """Helper class for Create""" + + +__all__ = ["Create"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/data_network/_delete.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/data_network/_delete.py new file mode 100644 index 00000000000..842aafe82c6 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/data_network/_delete.py @@ -0,0 +1,181 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network data-network delete", + confirmation="Are you sure you want to perform this operation?", +) +class Delete(AAZCommand): + """Delete the specified data network. + + :example: Delete data-network + az mobile-network data-network delete -n data_network-name --mobile-network-name mobile-network-name -g rg -y + """ + + _aaz_info = { + "version": "2022-11-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/mobilenetworks/{}/datanetworks/{}", "2022-11-01"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, None) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.data_network_name = AAZStrArg( + options=["-n", "--name", "--data-network-name"], + help="The name of the data network.", + required=True, + id_part="child_name_1", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])*(\.[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])*)*$", + max_length=64, + ), + ) + _args_schema.mobile_network_name = AAZStrArg( + options=["--mobile-network-name"], + help="The name of the mobile network.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + yield self.DataNetworksDelete(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + class DataNetworksDelete(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [204]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_204, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/mobileNetworks/{mobileNetworkName}/dataNetworks/{dataNetworkName}", + **self.url_parameters + ) + + @property + def method(self): + return "DELETE" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "dataNetworkName", self.ctx.args.data_network_name, + required=True, + ), + **self.serialize_url_param( + "mobileNetworkName", self.ctx.args.mobile_network_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + def on_200(self, session): + pass + + def on_204(self, session): + pass + + +class _DeleteHelper: + """Helper class for Delete""" + + +__all__ = ["Delete"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/data_network/_list.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/data_network/_list.py new file mode 100644 index 00000000000..b31c47b0648 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/data_network/_list.py @@ -0,0 +1,227 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network data-network list", +) +class List(AAZCommand): + """List all data networks in the mobile network. + + :example: List data-network by resource group + az mobile-network data-network list --mobile-network-name mobile-network-name -g rg + """ + + _aaz_info = { + "version": "2022-11-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/mobilenetworks/{}/datanetworks", "2022-11-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_paging(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.mobile_network_name = AAZStrArg( + options=["--mobile-network-name"], + help="The name of the mobile network.", + required=True, + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.DataNetworksListByMobileNetwork(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) + next_link = self.deserialize_output(self.ctx.vars.instance.next_link) + return result, next_link + + class DataNetworksListByMobileNetwork(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/mobileNetworks/{mobileNetworkName}/dataNetworks", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "mobileNetworkName", self.ctx.args.mobile_network_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.next_link = AAZStrType( + serialized_name="nextLink", + flags={"read_only": True}, + ) + _schema_on_200.value = AAZListType() + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.location = AAZStrType( + flags={"required": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _element.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _element.tags = AAZDictType() + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.description = AAZStrType() + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + system_data = cls._schema_on_200.value.Element.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.value.Element.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _ListHelper: + """Helper class for List""" + + +__all__ = ["List"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/data_network/_show.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/data_network/_show.py new file mode 100644 index 00000000000..d0a9a7cc574 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/data_network/_show.py @@ -0,0 +1,232 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network data-network show", +) +class Show(AAZCommand): + """Get information about the specified data network. + + :example: Show data-network + az mobile-network data-network show -n data-network-name --mobile-network-name mobile-network-name -g rg + """ + + _aaz_info = { + "version": "2022-11-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/mobilenetworks/{}/datanetworks/{}", "2022-11-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.data_network_name = AAZStrArg( + options=["-n", "--name", "--data-network-name"], + help="The name of the data network.", + required=True, + id_part="child_name_1", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])*(\.[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])*)*$", + max_length=64, + ), + ) + _args_schema.mobile_network_name = AAZStrArg( + options=["--mobile-network-name"], + help="The name of the mobile network.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.DataNetworksGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class DataNetworksGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/mobileNetworks/{mobileNetworkName}/dataNetworks/{dataNetworkName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "dataNetworkName", self.ctx.args.data_network_name, + required=True, + ), + **self.serialize_url_param( + "mobileNetworkName", self.ctx.args.mobile_network_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.location = AAZStrType( + flags={"required": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.description = AAZStrType() + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _ShowHelper: + """Helper class for Show""" + + +__all__ = ["Show"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/data_network/_update.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/data_network/_update.py new file mode 100644 index 00000000000..d075b52915c --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/data_network/_update.py @@ -0,0 +1,445 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network data-network update", +) +class Update(AAZCommand): + """Update a data network. + + :example: Update data-network tags + az mobile-network data-network update -n data-network-name -g rg --mobile-network-name mobile-network-name --tags "{tag:test,tag2:test2}" + """ + + _aaz_info = { + "version": "2022-11-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/mobilenetworks/{}/datanetworks/{}", "2022-11-01"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + AZ_SUPPORT_GENERIC_UPDATE = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.data_network_name = AAZStrArg( + options=["-n", "--name", "--data-network-name"], + help="The name of the data network.", + required=True, + id_part="child_name_1", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])*(\.[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])*)*$", + max_length=64, + ), + ) + _args_schema.mobile_network_name = AAZStrArg( + options=["--mobile-network-name"], + help="The name of the mobile network.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + + # define Arg Group "Parameters" + + _args_schema = cls._args_schema + _args_schema.tags = AAZDictArg( + options=["--tags"], + arg_group="Parameters", + help="Resource tags.", + nullable=True, + ) + + tags = cls._args_schema.tags + tags.Element = AAZStrArg( + nullable=True, + ) + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.description = AAZStrArg( + options=["--description"], + arg_group="Properties", + help="An optional description for this data network.", + nullable=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.DataNetworksGet(ctx=self.ctx)() + self.pre_instance_update(self.ctx.vars.instance) + self.InstanceUpdateByJson(ctx=self.ctx)() + self.InstanceUpdateByGeneric(ctx=self.ctx)() + self.post_instance_update(self.ctx.vars.instance) + yield self.DataNetworksCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + @register_callback + def pre_instance_update(self, instance): + pass + + @register_callback + def post_instance_update(self, instance): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class DataNetworksGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/mobileNetworks/{mobileNetworkName}/dataNetworks/{dataNetworkName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "dataNetworkName", self.ctx.args.data_network_name, + required=True, + ), + **self.serialize_url_param( + "mobileNetworkName", self.ctx.args.mobile_network_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + _UpdateHelper._build_schema_data_network_read(cls._schema_on_200) + + return cls._schema_on_200 + + class DataNetworksCreateOrUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200, 201]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/mobileNetworks/{mobileNetworkName}/dataNetworks/{dataNetworkName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "dataNetworkName", self.ctx.args.data_network_name, + required=True, + ), + **self.serialize_url_param( + "mobileNetworkName", self.ctx.args.mobile_network_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + value=self.ctx.vars.instance, + ) + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + _UpdateHelper._build_schema_data_network_read(cls._schema_on_200_201) + + return cls._schema_on_200_201 + + class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): + + def __call__(self, *args, **kwargs): + self._update_instance(self.ctx.vars.instance) + + def _update_instance(self, instance): + _instance_value, _builder = self.new_content_builder( + self.ctx.args, + value=instance, + typ=AAZObjectType + ) + _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) + _builder.set_prop("tags", AAZDictType, ".tags") + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("description", AAZStrType, ".description") + + tags = _builder.get(".tags") + if tags is not None: + tags.set_elements(AAZStrType, ".") + + return _instance_value + + class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): + + def __call__(self, *args, **kwargs): + self._update_instance_by_generic( + self.ctx.vars.instance, + self.ctx.generic_update_args + ) + + +class _UpdateHelper: + """Helper class for Update""" + + _schema_data_network_read = None + + @classmethod + def _build_schema_data_network_read(cls, _schema): + if cls._schema_data_network_read is not None: + _schema.id = cls._schema_data_network_read.id + _schema.location = cls._schema_data_network_read.location + _schema.name = cls._schema_data_network_read.name + _schema.properties = cls._schema_data_network_read.properties + _schema.system_data = cls._schema_data_network_read.system_data + _schema.tags = cls._schema_data_network_read.tags + _schema.type = cls._schema_data_network_read.type + return + + cls._schema_data_network_read = _schema_data_network_read = AAZObjectType() + + data_network_read = _schema_data_network_read + data_network_read.id = AAZStrType( + flags={"read_only": True}, + ) + data_network_read.location = AAZStrType( + flags={"required": True}, + ) + data_network_read.name = AAZStrType( + flags={"read_only": True}, + ) + data_network_read.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + data_network_read.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + data_network_read.tags = AAZDictType() + data_network_read.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = _schema_data_network_read.properties + properties.description = AAZStrType() + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + system_data = _schema_data_network_read.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = _schema_data_network_read.tags + tags.Element = AAZStrType() + + _schema.id = cls._schema_data_network_read.id + _schema.location = cls._schema_data_network_read.location + _schema.name = cls._schema_data_network_read.name + _schema.properties = cls._schema_data_network_read.properties + _schema.system_data = cls._schema_data_network_read.system_data + _schema.tags = cls._schema_data_network_read.tags + _schema.type = cls._schema_data_network_read.type + + +__all__ = ["Update"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/data_network/_wait.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/data_network/_wait.py new file mode 100644 index 00000000000..c564b34af83 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/data_network/_wait.py @@ -0,0 +1,228 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network data-network wait", +) +class Wait(AAZWaitCommand): + """Place the CLI in a waiting state until a condition is met. + """ + + _aaz_info = { + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/mobilenetworks/{}/datanetworks/{}", "2022-11-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.data_network_name = AAZStrArg( + options=["-n", "--name", "--data-network-name"], + help="The name of the data network.", + required=True, + id_part="child_name_1", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])*(\.[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])*)*$", + max_length=64, + ), + ) + _args_schema.mobile_network_name = AAZStrArg( + options=["--mobile-network-name"], + help="The name of the mobile network.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.DataNetworksGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) + return result + + class DataNetworksGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/mobileNetworks/{mobileNetworkName}/dataNetworks/{dataNetworkName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "dataNetworkName", self.ctx.args.data_network_name, + required=True, + ), + **self.serialize_url_param( + "mobileNetworkName", self.ctx.args.mobile_network_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.location = AAZStrType( + flags={"required": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.description = AAZStrType() + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _WaitHelper: + """Helper class for Wait""" + + +__all__ = ["Wait"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/__cmd_group.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/__cmd_group.py new file mode 100644 index 00000000000..fa6a1fa219a --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/__cmd_group.py @@ -0,0 +1,23 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command_group( + "mobile-network pccp", +) +class __CMDGroup(AAZCommandGroup): + """Manage packet core control plane + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/__init__.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/__init__.py new file mode 100644 index 00000000000..9c1a9a83ff8 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/__init__.py @@ -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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * +from ._collect_diagnostics_package import * +from ._create import * +from ._delete import * +from ._list import * +from ._reinstall import * +from ._rollback import * +from ._show import * +from ._update import * +from ._wait import * diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/_collect_diagnostics_package.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/_collect_diagnostics_package.py new file mode 100644 index 00000000000..b9e0294a796 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/_collect_diagnostics_package.py @@ -0,0 +1,278 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network pccp collect-diagnostics-package", +) +class CollectDiagnosticsPackage(AAZCommand): + """Collect a diagnostics package for the specified packet core control plane. This action will upload the diagnostics to a storage account. + + :example: Collect diagnostics package + az mobile-network pccp collect-diagnostics-package --pccp-name pccp -g rg --blob-url https://contosoaccount.blob.core.windows.net/container/diagnosticsPackage.zip + """ + + _aaz_info = { + "version": "2022-11-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/packetcorecontrolplanes/{}/collectdiagnosticspackage", "2022-11-01"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.pccp_name = AAZStrArg( + options=["--pccp-name"], + help="The name of the packet core control plane.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + + # define Arg Group "Parameters" + + _args_schema = cls._args_schema + _args_schema.blob_url = AAZStrArg( + options=["--blob-url"], + arg_group="Parameters", + help="The Storage Account Blob URL to upload the diagnostics package to.", + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + yield self.PacketCoreControlPlaneCollectDiagnosticsPackage(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class PacketCoreControlPlaneCollectDiagnosticsPackage(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/{packetCoreControlPlaneName}/collectDiagnosticsPackage", + **self.url_parameters + ) + + @property + def method(self): + return "POST" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "packetCoreControlPlaneName", self.ctx.args.pccp_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + typ=AAZObjectType, + typ_kwargs={"flags": {"required": True, "client_flatten": True}} + ) + _builder.set_prop("storageAccountBlobUrl", AAZStrType, ".blob_url", typ_kwargs={"flags": {"required": True}}) + + return self.serialize_content(_content_value) + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.end_time = AAZStrType( + serialized_name="endTime", + ) + _schema_on_200.error = AAZObjectType() + _CollectDiagnosticsPackageHelper._build_schema_error_detail_read(_schema_on_200.error) + _schema_on_200.id = AAZStrType() + _schema_on_200.name = AAZStrType() + _schema_on_200.percent_complete = AAZFloatType( + serialized_name="percentComplete", + ) + _schema_on_200.resource_id = AAZStrType( + serialized_name="resourceId", + ) + _schema_on_200.start_time = AAZStrType( + serialized_name="startTime", + ) + _schema_on_200.status = AAZStrType( + flags={"required": True}, + ) + + return cls._schema_on_200 + + +class _CollectDiagnosticsPackageHelper: + """Helper class for CollectDiagnosticsPackage""" + + _schema_error_detail_read = None + + @classmethod + def _build_schema_error_detail_read(cls, _schema): + if cls._schema_error_detail_read is not None: + _schema.additional_info = cls._schema_error_detail_read.additional_info + _schema.code = cls._schema_error_detail_read.code + _schema.details = cls._schema_error_detail_read.details + _schema.message = cls._schema_error_detail_read.message + _schema.target = cls._schema_error_detail_read.target + return + + cls._schema_error_detail_read = _schema_error_detail_read = AAZObjectType() + + error_detail_read = _schema_error_detail_read + error_detail_read.additional_info = AAZListType( + serialized_name="additionalInfo", + flags={"read_only": True}, + ) + error_detail_read.code = AAZStrType( + flags={"read_only": True}, + ) + error_detail_read.details = AAZListType( + flags={"read_only": True}, + ) + error_detail_read.message = AAZStrType( + flags={"read_only": True}, + ) + error_detail_read.target = AAZStrType( + flags={"read_only": True}, + ) + + additional_info = _schema_error_detail_read.additional_info + additional_info.Element = AAZObjectType() + + _element = _schema_error_detail_read.additional_info.Element + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + details = _schema_error_detail_read.details + details.Element = AAZObjectType() + cls._build_schema_error_detail_read(details.Element) + + _schema.additional_info = cls._schema_error_detail_read.additional_info + _schema.code = cls._schema_error_detail_read.code + _schema.details = cls._schema_error_detail_read.details + _schema.message = cls._schema_error_detail_read.message + _schema.target = cls._schema_error_detail_read.target + + +__all__ = ["CollectDiagnosticsPackage"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/_create.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/_create.py new file mode 100644 index 00000000000..e253840dabb --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/_create.py @@ -0,0 +1,717 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network pccp create", +) +class Create(AAZCommand): + """Create a packet core control plane. + + :example: Create Packet Core Control Plane + az mobile-network pccp create -n pccp-name -g rg --access-interface "{name:N2,ipv4Address:10.28.128.2,ipv4Subnet:10.28.128.0/24,ipv4Gateway:10.28.128.1}" --local-diagnostics "{authentication-type:AAD}" --platform "{type:AKS-HCI}" --sites "[{id:site-id}]" --sku G0 + """ + + _aaz_info = { + "version": "2022-11-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/packetcorecontrolplanes/{}", "2022-11-01"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.pccp_name = AAZStrArg( + options=["-n", "--name", "--pccp-name"], + help="The name of the packet core control plane.", + required=True, + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + + # define Arg Group "Parameters" + + _args_schema = cls._args_schema + _args_schema.identity = AAZObjectArg( + options=["--identity"], + arg_group="Parameters", + help="The identity used to retrieve the ingress certificate from Azure key vault.", + ) + _args_schema.location = AAZResourceLocationArg( + arg_group="Parameters", + help="The geo-location where the resource lives", + required=True, + fmt=AAZResourceLocationArgFormat( + resource_group_arg="resource_group", + ), + ) + _args_schema.tags = AAZDictArg( + options=["--tags"], + arg_group="Parameters", + help="Resource tags.", + ) + + identity = cls._args_schema.identity + identity.type = AAZStrArg( + options=["type"], + help="Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).", + required=True, + enum={"None": "None", "SystemAssigned": "SystemAssigned", "SystemAssigned,UserAssigned": "SystemAssigned,UserAssigned", "UserAssigned": "UserAssigned"}, + ) + identity.user_assigned_identities = AAZDictArg( + options=["user-assigned-identities"], + help="The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests.", + ) + + user_assigned_identities = cls._args_schema.identity.user_assigned_identities + user_assigned_identities.Element = AAZObjectArg( + blank={}, + ) + + tags = cls._args_schema.tags + tags.Element = AAZStrArg() + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.access_interface = AAZObjectArg( + options=["--access-interface"], + arg_group="Properties", + help="The control plane interface on the access network. For 5G networks, this is the N2 interface. For 4G networks, this is the S1-MME interface.", + required=True, + ) + _args_schema.core_network_tec = AAZStrArg( + options=["--core-network-tec"], + arg_group="Properties", + help="The core network technology generation (5G core or EPC / 4G core).", + default="5GC", + enum={"5GC": "5GC", "EPC": "EPC"}, + ) + _args_schema.local_diagnostics = AAZObjectArg( + options=["--local-diagnostics"], + arg_group="Properties", + help="The kubernetes ingress configuration to control access to packet core diagnostics over local APIs.", + required=True, + ) + _args_schema.platform = AAZObjectArg( + options=["--platform"], + arg_group="Properties", + help="The platform where the packet core is deployed.", + required=True, + ) + _args_schema.sites = AAZListArg( + options=["--sites"], + arg_group="Properties", + help="Site(s) under which this packet core control plane should be deployed. The sites must be in the same location as the packet core control plane.", + required=True, + fmt=AAZListArgFormat( + unique=True, + ), + ) + _args_schema.sku = AAZStrArg( + options=["--sku"], + arg_group="Properties", + help="The SKU defining the throughput and SIM allowances for this packet core control plane deployment.", + required=True, + enum={"G0": "G0", "G1": "G1", "G10": "G10", "G2": "G2", "G3": "G3", "G4": "G4", "G5": "G5"}, + ) + _args_schema.ue_mtu = AAZIntArg( + options=["--ue-mtu"], + arg_group="Properties", + help="The MTU (in bytes) signaled to the UE. The same MTU is set on the user plane data links for all data networks. The MTU set on the user plane access link is calculated to be 60 bytes greater than this value to allow for GTP encapsulation.", + default=1440, + fmt=AAZIntArgFormat( + maximum=1930, + minimum=1280, + ), + ) + _args_schema.version = AAZStrArg( + options=["--version"], + arg_group="Properties", + help="The version of the packet core software that is deployed.", + ) + + access_interface = cls._args_schema.access_interface + access_interface.ipv4_address = AAZStrArg( + options=["ipv4-address"], + help="The IPv4 address.", + fmt=AAZStrArgFormat( + pattern="^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$", + ), + ) + access_interface.ipv4_gateway = AAZStrArg( + options=["ipv4-gateway"], + help="The default IPv4 gateway (router).", + fmt=AAZStrArgFormat( + pattern="^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$", + ), + ) + access_interface.ipv4_subnet = AAZStrArg( + options=["ipv4-subnet"], + help="The IPv4 subnet.", + fmt=AAZStrArgFormat( + pattern="^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$", + ), + ) + access_interface.name = AAZStrArg( + options=["name"], + help="The logical name for this interface. This should match one of the interfaces configured on your Azure Stack Edge device.", + ) + + local_diagnostics = cls._args_schema.local_diagnostics + local_diagnostics.authentication_type = AAZStrArg( + options=["authentication-type"], + help="How to authenticate users who access local diagnostics APIs.", + required=True, + enum={"AAD": "AAD", "Password": "Password"}, + ) + local_diagnostics.https_server_certificate = AAZObjectArg( + options=["https-server-certificate"], + help="The HTTPS server TLS certificate used to secure local access to diagnostics.", + ) + + https_server_certificate = cls._args_schema.local_diagnostics.https_server_certificate + https_server_certificate.certificate_url = AAZStrArg( + options=["certificate-url"], + help="The certificate URL, unversioned. For example: https://contosovault.vault.azure.net/certificates/ingress.", + required=True, + ) + + platform = cls._args_schema.platform + platform.azure_stack_edge_device = AAZObjectArg( + options=["azure-stack-edge-device"], + help="The Azure Stack Edge device where where the packet core is deployed. If the device is part of a fault tolerant pair, either device in the pair can be specified.", + ) + platform.azure_stack_hci_cluster = AAZObjectArg( + options=["azure-stack-hci-cluster"], + help="The Azure Stack HCI cluster where the packet core is deployed.", + ) + platform.connected_cluster = AAZObjectArg( + options=["connected-cluster"], + help="Azure Arc connected cluster where the packet core is deployed.", + ) + platform.custom_location = AAZObjectArg( + options=["custom-location"], + help="Azure Arc custom location where the packet core is deployed.", + ) + platform.type = AAZStrArg( + options=["type"], + help="The platform type where packet core is deployed.", + required=True, + enum={"3P-AZURE-STACK-HCI": "3P-AZURE-STACK-HCI", "AKS-HCI": "AKS-HCI"}, + ) + + azure_stack_edge_device = cls._args_schema.platform.azure_stack_edge_device + azure_stack_edge_device.id = AAZStrArg( + options=["id"], + help="Azure Stack Edge device resource ID.", + required=True, + fmt=AAZStrArgFormat( + pattern="^/[sS][uU][bB][sS][cC][rR][iI][pP][tT][iI][oO][nN][sS]/[^/?#]+/[rR][eE][sS][oO][uU][rR][cC][eE][gG][rR][oO][uU][pP][sS]/[^/?#]+/[pP][rR][oO][vV][iI][dD][eE][rR][sS]/[mM][iI][cC][rR][oO][sS][oO][fF][tT]\.[dD][aA][tT][aA][bB][oO][xX][eE][dD][gG][eE]/[dD][aA][tT][aA][bB][oO][xX][eE][dD][gG][eE][dD][eE][vV][iI][cC][eE][sS]/[^/?#]+$", + ), + ) + + azure_stack_hci_cluster = cls._args_schema.platform.azure_stack_hci_cluster + azure_stack_hci_cluster.id = AAZStrArg( + options=["id"], + help="Azure Stack HCI cluster resource ID.", + required=True, + fmt=AAZStrArgFormat( + pattern="^/[sS][uU][bB][sS][cC][rR][iI][pP][tT][iI][oO][nN][sS]/[^/?#]+/[rR][eE][sS][oO][uU][rR][cC][eE][gG][rR][oO][uU][pP][sS]/[^/?#]+/[pP][rR][oO][vV][iI][dD][eE][rR][sS]/[mM][iI][cC][rR][oO][sS][oO][fF][tT]\.[aA][zZ][uU][rR][eE][sS][tT][aA][cC][kK][hH][cC][iI]/[cC][lL][uU][sS][tT][eE][rR][sS]/[^/?#]+$", + ), + ) + + connected_cluster = cls._args_schema.platform.connected_cluster + connected_cluster.id = AAZStrArg( + options=["id"], + help="Azure Arc connected cluster resource ID.", + required=True, + fmt=AAZStrArgFormat( + pattern="^/[sS][uU][bB][sS][cC][rR][iI][pP][tT][iI][oO][nN][sS]/[^/?#]+/[rR][eE][sS][oO][uU][rR][cC][eE][gG][rR][oO][uU][pP][sS]/[^/?#]+/[pP][rR][oO][vV][iI][dD][eE][rR][sS]/[mM][iI][cC][rR][oO][sS][oO][fF][tT]\.[kK][uU][bB][eE][rR][nN][eE][tT][eE][sS]/[cC][oO][nN][nN][eE][cC][tT][eE][dD][cC][lL][uU][sS][tT][eE][rR][sS]/[^/?#]+$", + ), + ) + + custom_location = cls._args_schema.platform.custom_location + custom_location.id = AAZStrArg( + options=["id"], + help="Azure Arc custom location resource ID.", + required=True, + fmt=AAZStrArgFormat( + pattern="^/[sS][uU][bB][sS][cC][rR][iI][pP][tT][iI][oO][nN][sS]/[^/?#]+/[rR][eE][sS][oO][uU][rR][cC][eE][gG][rR][oO][uU][pP][sS]/[^/?#]+/[pP][rR][oO][vV][iI][dD][eE][rR][sS]/[mM][iI][cC][rR][oO][sS][oO][fF][tT]\.[eE][xX][tT][eE][nN][dD][eE][dD][lL][oO][cC][aA][tT][iI][oO][nN]/[cC][uU][sS][tT][oO][mM][lL][oO][cC][aA][tT][iI][oO][nN][sS]/[^/?#]+$", + ), + ) + + sites = cls._args_schema.sites + sites.Element = AAZObjectArg() + + _element = cls._args_schema.sites.Element + _element.id = AAZStrArg( + options=["id"], + help="Site resource ID.", + required=True, + fmt=AAZStrArgFormat( + pattern="^/[sS][uU][bB][sS][cC][rR][iI][pP][tT][iI][oO][nN][sS]/[^/?#]+/[rR][eE][sS][oO][uU][rR][cC][eE][gG][rR][oO][uU][pP][sS]/[^/?#]+/[pP][rR][oO][vV][iI][dD][eE][rR][sS]/[mM][iI][cC][rR][oO][sS][oO][fF][tT]\.[mM][oO][bB][iI][lL][eE][nN][eE][tT][wW][oO][rR][kK]/[mM][oO][bB][iI][lL][eE][nN][eE][tT][wW][oO][rR][kK][sS]/[^/?#]+/[sS][iI][tT][eE][sS]/[^/?#]+$", + ), + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + yield self.PacketCoreControlPlanesCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class PacketCoreControlPlanesCreateOrUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200, 201]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/{packetCoreControlPlaneName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "packetCoreControlPlaneName", self.ctx.args.pccp_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + typ=AAZObjectType, + typ_kwargs={"flags": {"required": True, "client_flatten": True}} + ) + _builder.set_prop("identity", AAZObjectType, ".identity") + _builder.set_prop("location", AAZStrType, ".location", typ_kwargs={"flags": {"required": True}}) + _builder.set_prop("properties", AAZObjectType, ".", typ_kwargs={"flags": {"required": True, "client_flatten": True}}) + _builder.set_prop("tags", AAZDictType, ".tags") + + identity = _builder.get(".identity") + if identity is not None: + identity.set_prop("type", AAZStrType, ".type", typ_kwargs={"flags": {"required": True}}) + identity.set_prop("userAssignedIdentities", AAZDictType, ".user_assigned_identities") + + user_assigned_identities = _builder.get(".identity.userAssignedIdentities") + if user_assigned_identities is not None: + user_assigned_identities.set_elements(AAZObjectType, ".") + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("controlPlaneAccessInterface", AAZObjectType, ".access_interface", typ_kwargs={"flags": {"required": True}}) + properties.set_prop("coreNetworkTechnology", AAZStrType, ".core_network_tec") + properties.set_prop("localDiagnosticsAccess", AAZObjectType, ".local_diagnostics", typ_kwargs={"flags": {"required": True}}) + properties.set_prop("platform", AAZObjectType, ".platform", typ_kwargs={"flags": {"required": True}}) + properties.set_prop("sites", AAZListType, ".sites", typ_kwargs={"flags": {"required": True}}) + properties.set_prop("sku", AAZStrType, ".sku", typ_kwargs={"flags": {"required": True}}) + properties.set_prop("ueMtu", AAZIntType, ".ue_mtu") + properties.set_prop("version", AAZStrType, ".version") + + control_plane_access_interface = _builder.get(".properties.controlPlaneAccessInterface") + if control_plane_access_interface is not None: + control_plane_access_interface.set_prop("ipv4Address", AAZStrType, ".ipv4_address") + control_plane_access_interface.set_prop("ipv4Gateway", AAZStrType, ".ipv4_gateway") + control_plane_access_interface.set_prop("ipv4Subnet", AAZStrType, ".ipv4_subnet") + control_plane_access_interface.set_prop("name", AAZStrType, ".name") + + local_diagnostics_access = _builder.get(".properties.localDiagnosticsAccess") + if local_diagnostics_access is not None: + local_diagnostics_access.set_prop("authenticationType", AAZStrType, ".authentication_type", typ_kwargs={"flags": {"required": True}}) + local_diagnostics_access.set_prop("httpsServerCertificate", AAZObjectType, ".https_server_certificate") + + https_server_certificate = _builder.get(".properties.localDiagnosticsAccess.httpsServerCertificate") + if https_server_certificate is not None: + https_server_certificate.set_prop("certificateUrl", AAZStrType, ".certificate_url", typ_kwargs={"flags": {"required": True}}) + + platform = _builder.get(".properties.platform") + if platform is not None: + platform.set_prop("azureStackEdgeDevice", AAZObjectType, ".azure_stack_edge_device") + platform.set_prop("azureStackHciCluster", AAZObjectType, ".azure_stack_hci_cluster") + platform.set_prop("connectedCluster", AAZObjectType, ".connected_cluster") + platform.set_prop("customLocation", AAZObjectType, ".custom_location") + platform.set_prop("type", AAZStrType, ".type", typ_kwargs={"flags": {"required": True}}) + + azure_stack_edge_device = _builder.get(".properties.platform.azureStackEdgeDevice") + if azure_stack_edge_device is not None: + azure_stack_edge_device.set_prop("id", AAZStrType, ".id", typ_kwargs={"flags": {"required": True}}) + + azure_stack_hci_cluster = _builder.get(".properties.platform.azureStackHciCluster") + if azure_stack_hci_cluster is not None: + azure_stack_hci_cluster.set_prop("id", AAZStrType, ".id", typ_kwargs={"flags": {"required": True}}) + + connected_cluster = _builder.get(".properties.platform.connectedCluster") + if connected_cluster is not None: + connected_cluster.set_prop("id", AAZStrType, ".id", typ_kwargs={"flags": {"required": True}}) + + custom_location = _builder.get(".properties.platform.customLocation") + if custom_location is not None: + custom_location.set_prop("id", AAZStrType, ".id", typ_kwargs={"flags": {"required": True}}) + + sites = _builder.get(".properties.sites") + if sites is not None: + sites.set_elements(AAZObjectType, ".") + + _elements = _builder.get(".properties.sites[]") + if _elements is not None: + _elements.set_prop("id", AAZStrType, ".id", typ_kwargs={"flags": {"required": True}}) + + tags = _builder.get(".tags") + if tags is not None: + tags.set_elements(AAZStrType, ".") + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + + _schema_on_200_201 = cls._schema_on_200_201 + _schema_on_200_201.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.identity = AAZObjectType() + _schema_on_200_201.location = AAZStrType( + flags={"required": True}, + ) + _schema_on_200_201.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.properties = AAZObjectType( + flags={"required": True, "client_flatten": True}, + ) + _schema_on_200_201.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200_201.tags = AAZDictType() + _schema_on_200_201.type = AAZStrType( + flags={"read_only": True}, + ) + + identity = cls._schema_on_200_201.identity + identity.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + identity.tenant_id = AAZStrType( + serialized_name="tenantId", + flags={"read_only": True}, + ) + identity.type = AAZStrType( + flags={"required": True}, + ) + identity.user_assigned_identities = AAZDictType( + serialized_name="userAssignedIdentities", + ) + + user_assigned_identities = cls._schema_on_200_201.identity.user_assigned_identities + user_assigned_identities.Element = AAZObjectType() + + _element = cls._schema_on_200_201.identity.user_assigned_identities.Element + _element.client_id = AAZStrType( + serialized_name="clientId", + flags={"read_only": True}, + ) + _element.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + + properties = cls._schema_on_200_201.properties + properties.control_plane_access_interface = AAZObjectType( + serialized_name="controlPlaneAccessInterface", + flags={"required": True}, + ) + properties.core_network_technology = AAZStrType( + serialized_name="coreNetworkTechnology", + ) + properties.installation = AAZObjectType() + properties.local_diagnostics_access = AAZObjectType( + serialized_name="localDiagnosticsAccess", + flags={"required": True}, + ) + properties.platform = AAZObjectType( + flags={"required": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.rollback_version = AAZStrType( + serialized_name="rollbackVersion", + flags={"read_only": True}, + ) + properties.sites = AAZListType( + flags={"required": True}, + ) + properties.sku = AAZStrType( + flags={"required": True}, + ) + properties.ue_mtu = AAZIntType( + serialized_name="ueMtu", + ) + properties.version = AAZStrType() + + control_plane_access_interface = cls._schema_on_200_201.properties.control_plane_access_interface + control_plane_access_interface.ipv4_address = AAZStrType( + serialized_name="ipv4Address", + ) + control_plane_access_interface.ipv4_gateway = AAZStrType( + serialized_name="ipv4Gateway", + ) + control_plane_access_interface.ipv4_subnet = AAZStrType( + serialized_name="ipv4Subnet", + ) + control_plane_access_interface.name = AAZStrType() + + installation = cls._schema_on_200_201.properties.installation + installation.operation = AAZObjectType() + installation.state = AAZStrType() + + operation = cls._schema_on_200_201.properties.installation.operation + operation.id = AAZStrType( + flags={"required": True}, + ) + + local_diagnostics_access = cls._schema_on_200_201.properties.local_diagnostics_access + local_diagnostics_access.authentication_type = AAZStrType( + serialized_name="authenticationType", + flags={"required": True}, + ) + local_diagnostics_access.https_server_certificate = AAZObjectType( + serialized_name="httpsServerCertificate", + ) + + https_server_certificate = cls._schema_on_200_201.properties.local_diagnostics_access.https_server_certificate + https_server_certificate.certificate_url = AAZStrType( + serialized_name="certificateUrl", + flags={"required": True}, + ) + https_server_certificate.provisioning = AAZObjectType() + + provisioning = cls._schema_on_200_201.properties.local_diagnostics_access.https_server_certificate.provisioning + provisioning.reason = AAZStrType( + flags={"read_only": True}, + ) + provisioning.state = AAZStrType( + flags={"read_only": True}, + ) + + platform = cls._schema_on_200_201.properties.platform + platform.azure_stack_edge_device = AAZObjectType( + serialized_name="azureStackEdgeDevice", + ) + _CreateHelper._build_schema_azure_stack_edge_device_resource_id_read(platform.azure_stack_edge_device) + platform.azure_stack_edge_devices = AAZListType( + serialized_name="azureStackEdgeDevices", + flags={"read_only": True}, + ) + platform.azure_stack_hci_cluster = AAZObjectType( + serialized_name="azureStackHciCluster", + ) + platform.connected_cluster = AAZObjectType( + serialized_name="connectedCluster", + ) + platform.custom_location = AAZObjectType( + serialized_name="customLocation", + ) + platform.type = AAZStrType( + flags={"required": True}, + ) + + azure_stack_edge_devices = cls._schema_on_200_201.properties.platform.azure_stack_edge_devices + azure_stack_edge_devices.Element = AAZObjectType() + _CreateHelper._build_schema_azure_stack_edge_device_resource_id_read(azure_stack_edge_devices.Element) + + azure_stack_hci_cluster = cls._schema_on_200_201.properties.platform.azure_stack_hci_cluster + azure_stack_hci_cluster.id = AAZStrType( + flags={"required": True}, + ) + + connected_cluster = cls._schema_on_200_201.properties.platform.connected_cluster + connected_cluster.id = AAZStrType( + flags={"required": True}, + ) + + custom_location = cls._schema_on_200_201.properties.platform.custom_location + custom_location.id = AAZStrType( + flags={"required": True}, + ) + + sites = cls._schema_on_200_201.properties.sites + sites.Element = AAZObjectType() + + _element = cls._schema_on_200_201.properties.sites.Element + _element.id = AAZStrType( + flags={"required": True}, + ) + + system_data = cls._schema_on_200_201.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200_201.tags + tags.Element = AAZStrType() + + return cls._schema_on_200_201 + + +class _CreateHelper: + """Helper class for Create""" + + _schema_azure_stack_edge_device_resource_id_read = None + + @classmethod + def _build_schema_azure_stack_edge_device_resource_id_read(cls, _schema): + if cls._schema_azure_stack_edge_device_resource_id_read is not None: + _schema.id = cls._schema_azure_stack_edge_device_resource_id_read.id + return + + cls._schema_azure_stack_edge_device_resource_id_read = _schema_azure_stack_edge_device_resource_id_read = AAZObjectType() + + azure_stack_edge_device_resource_id_read = _schema_azure_stack_edge_device_resource_id_read + azure_stack_edge_device_resource_id_read.id = AAZStrType( + flags={"required": True}, + ) + + _schema.id = cls._schema_azure_stack_edge_device_resource_id_read.id + + +__all__ = ["Create"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/_delete.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/_delete.py new file mode 100644 index 00000000000..ba180a7de8d --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/_delete.py @@ -0,0 +1,167 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network pccp delete", + confirmation="Are you sure you want to perform this operation?", +) +class Delete(AAZCommand): + """Delete the specified packet core control plane. + + :example: Delete Packet Core Control Plane + az mobile-network pccp delete -n pccp-name -g rg -y + """ + + _aaz_info = { + "version": "2022-11-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/packetcorecontrolplanes/{}", "2022-11-01"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, None) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.pccp_name = AAZStrArg( + options=["-n", "--name", "--pccp-name"], + help="The name of the packet core control plane.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + yield self.PacketCoreControlPlanesDelete(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + class PacketCoreControlPlanesDelete(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [204]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_204, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/{packetCoreControlPlaneName}", + **self.url_parameters + ) + + @property + def method(self): + return "DELETE" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "packetCoreControlPlaneName", self.ctx.args.pccp_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + def on_200(self, session): + pass + + def on_204(self, session): + pass + + +class _DeleteHelper: + """Helper class for Delete""" + + +__all__ = ["Delete"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/_list.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/_list.py new file mode 100644 index 00000000000..0f4d33115d0 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/_list.py @@ -0,0 +1,675 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network pccp list", +) +class List(AAZCommand): + """List all the packet core control planes in a subscription. + + :example: List Packet Core Control Plane by resource group + az mobile-network pccp list -g rg + """ + + _aaz_info = { + "version": "2022-11-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/providers/microsoft.mobilenetwork/packetcorecontrolplanes", "2022-11-01"], + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/packetcorecontrolplanes", "2022-11-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_paging(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.resource_group = AAZResourceGroupNameArg() + return cls._args_schema + + 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 + if condition_0: + self.PacketCoreControlPlanesListByResourceGroup(ctx=self.ctx)() + if condition_1: + self.PacketCoreControlPlanesListBySubscription(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) + next_link = self.deserialize_output(self.ctx.vars.instance.next_link) + return result, next_link + + class PacketCoreControlPlanesListByResourceGroup(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/packetCoreControlPlanes", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @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, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.next_link = AAZStrType( + serialized_name="nextLink", + flags={"read_only": True}, + ) + _schema_on_200.value = AAZListType() + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.identity = AAZObjectType() + _element.location = AAZStrType( + flags={"required": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType( + flags={"required": True, "client_flatten": True}, + ) + _element.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _element.tags = AAZDictType() + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + identity = cls._schema_on_200.value.Element.identity + identity.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + identity.tenant_id = AAZStrType( + serialized_name="tenantId", + flags={"read_only": True}, + ) + identity.type = AAZStrType( + flags={"required": True}, + ) + identity.user_assigned_identities = AAZDictType( + serialized_name="userAssignedIdentities", + ) + + user_assigned_identities = cls._schema_on_200.value.Element.identity.user_assigned_identities + user_assigned_identities.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element.identity.user_assigned_identities.Element + _element.client_id = AAZStrType( + serialized_name="clientId", + flags={"read_only": True}, + ) + _element.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.control_plane_access_interface = AAZObjectType( + serialized_name="controlPlaneAccessInterface", + flags={"required": True}, + ) + properties.core_network_technology = AAZStrType( + serialized_name="coreNetworkTechnology", + ) + properties.installation = AAZObjectType() + properties.local_diagnostics_access = AAZObjectType( + serialized_name="localDiagnosticsAccess", + flags={"required": True}, + ) + properties.platform = AAZObjectType( + flags={"required": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.rollback_version = AAZStrType( + serialized_name="rollbackVersion", + flags={"read_only": True}, + ) + properties.sites = AAZListType( + flags={"required": True}, + ) + properties.sku = AAZStrType( + flags={"required": True}, + ) + properties.ue_mtu = AAZIntType( + serialized_name="ueMtu", + ) + properties.version = AAZStrType() + + control_plane_access_interface = cls._schema_on_200.value.Element.properties.control_plane_access_interface + control_plane_access_interface.ipv4_address = AAZStrType( + serialized_name="ipv4Address", + ) + control_plane_access_interface.ipv4_gateway = AAZStrType( + serialized_name="ipv4Gateway", + ) + control_plane_access_interface.ipv4_subnet = AAZStrType( + serialized_name="ipv4Subnet", + ) + control_plane_access_interface.name = AAZStrType() + + installation = cls._schema_on_200.value.Element.properties.installation + installation.operation = AAZObjectType() + installation.state = AAZStrType() + + operation = cls._schema_on_200.value.Element.properties.installation.operation + operation.id = AAZStrType( + flags={"required": True}, + ) + + local_diagnostics_access = cls._schema_on_200.value.Element.properties.local_diagnostics_access + local_diagnostics_access.authentication_type = AAZStrType( + serialized_name="authenticationType", + flags={"required": True}, + ) + local_diagnostics_access.https_server_certificate = AAZObjectType( + serialized_name="httpsServerCertificate", + ) + + https_server_certificate = cls._schema_on_200.value.Element.properties.local_diagnostics_access.https_server_certificate + https_server_certificate.certificate_url = AAZStrType( + serialized_name="certificateUrl", + flags={"required": True}, + ) + https_server_certificate.provisioning = AAZObjectType() + + provisioning = cls._schema_on_200.value.Element.properties.local_diagnostics_access.https_server_certificate.provisioning + provisioning.reason = AAZStrType( + flags={"read_only": True}, + ) + provisioning.state = AAZStrType( + flags={"read_only": True}, + ) + + platform = cls._schema_on_200.value.Element.properties.platform + platform.azure_stack_edge_device = AAZObjectType( + serialized_name="azureStackEdgeDevice", + ) + _ListHelper._build_schema_azure_stack_edge_device_resource_id_read(platform.azure_stack_edge_device) + platform.azure_stack_edge_devices = AAZListType( + serialized_name="azureStackEdgeDevices", + flags={"read_only": True}, + ) + platform.azure_stack_hci_cluster = AAZObjectType( + serialized_name="azureStackHciCluster", + ) + platform.connected_cluster = AAZObjectType( + serialized_name="connectedCluster", + ) + platform.custom_location = AAZObjectType( + serialized_name="customLocation", + ) + platform.type = AAZStrType( + flags={"required": True}, + ) + + azure_stack_edge_devices = cls._schema_on_200.value.Element.properties.platform.azure_stack_edge_devices + azure_stack_edge_devices.Element = AAZObjectType() + _ListHelper._build_schema_azure_stack_edge_device_resource_id_read(azure_stack_edge_devices.Element) + + azure_stack_hci_cluster = cls._schema_on_200.value.Element.properties.platform.azure_stack_hci_cluster + azure_stack_hci_cluster.id = AAZStrType( + flags={"required": True}, + ) + + connected_cluster = cls._schema_on_200.value.Element.properties.platform.connected_cluster + connected_cluster.id = AAZStrType( + flags={"required": True}, + ) + + custom_location = cls._schema_on_200.value.Element.properties.platform.custom_location + custom_location.id = AAZStrType( + flags={"required": True}, + ) + + sites = cls._schema_on_200.value.Element.properties.sites + sites.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element.properties.sites.Element + _element.id = AAZStrType( + flags={"required": True}, + ) + + system_data = cls._schema_on_200.value.Element.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.value.Element.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + class PacketCoreControlPlanesListBySubscription(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/providers/Microsoft.MobileNetwork/packetCoreControlPlanes", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.next_link = AAZStrType( + serialized_name="nextLink", + flags={"read_only": True}, + ) + _schema_on_200.value = AAZListType() + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.identity = AAZObjectType() + _element.location = AAZStrType( + flags={"required": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType( + flags={"required": True, "client_flatten": True}, + ) + _element.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _element.tags = AAZDictType() + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + identity = cls._schema_on_200.value.Element.identity + identity.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + identity.tenant_id = AAZStrType( + serialized_name="tenantId", + flags={"read_only": True}, + ) + identity.type = AAZStrType( + flags={"required": True}, + ) + identity.user_assigned_identities = AAZDictType( + serialized_name="userAssignedIdentities", + ) + + user_assigned_identities = cls._schema_on_200.value.Element.identity.user_assigned_identities + user_assigned_identities.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element.identity.user_assigned_identities.Element + _element.client_id = AAZStrType( + serialized_name="clientId", + flags={"read_only": True}, + ) + _element.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.control_plane_access_interface = AAZObjectType( + serialized_name="controlPlaneAccessInterface", + flags={"required": True}, + ) + properties.core_network_technology = AAZStrType( + serialized_name="coreNetworkTechnology", + ) + properties.installation = AAZObjectType() + properties.local_diagnostics_access = AAZObjectType( + serialized_name="localDiagnosticsAccess", + flags={"required": True}, + ) + properties.platform = AAZObjectType( + flags={"required": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.rollback_version = AAZStrType( + serialized_name="rollbackVersion", + flags={"read_only": True}, + ) + properties.sites = AAZListType( + flags={"required": True}, + ) + properties.sku = AAZStrType( + flags={"required": True}, + ) + properties.ue_mtu = AAZIntType( + serialized_name="ueMtu", + ) + properties.version = AAZStrType() + + control_plane_access_interface = cls._schema_on_200.value.Element.properties.control_plane_access_interface + control_plane_access_interface.ipv4_address = AAZStrType( + serialized_name="ipv4Address", + ) + control_plane_access_interface.ipv4_gateway = AAZStrType( + serialized_name="ipv4Gateway", + ) + control_plane_access_interface.ipv4_subnet = AAZStrType( + serialized_name="ipv4Subnet", + ) + control_plane_access_interface.name = AAZStrType() + + installation = cls._schema_on_200.value.Element.properties.installation + installation.operation = AAZObjectType() + installation.state = AAZStrType() + + operation = cls._schema_on_200.value.Element.properties.installation.operation + operation.id = AAZStrType( + flags={"required": True}, + ) + + local_diagnostics_access = cls._schema_on_200.value.Element.properties.local_diagnostics_access + local_diagnostics_access.authentication_type = AAZStrType( + serialized_name="authenticationType", + flags={"required": True}, + ) + local_diagnostics_access.https_server_certificate = AAZObjectType( + serialized_name="httpsServerCertificate", + ) + + https_server_certificate = cls._schema_on_200.value.Element.properties.local_diagnostics_access.https_server_certificate + https_server_certificate.certificate_url = AAZStrType( + serialized_name="certificateUrl", + flags={"required": True}, + ) + https_server_certificate.provisioning = AAZObjectType() + + provisioning = cls._schema_on_200.value.Element.properties.local_diagnostics_access.https_server_certificate.provisioning + provisioning.reason = AAZStrType( + flags={"read_only": True}, + ) + provisioning.state = AAZStrType( + flags={"read_only": True}, + ) + + platform = cls._schema_on_200.value.Element.properties.platform + platform.azure_stack_edge_device = AAZObjectType( + serialized_name="azureStackEdgeDevice", + ) + _ListHelper._build_schema_azure_stack_edge_device_resource_id_read(platform.azure_stack_edge_device) + platform.azure_stack_edge_devices = AAZListType( + serialized_name="azureStackEdgeDevices", + flags={"read_only": True}, + ) + platform.azure_stack_hci_cluster = AAZObjectType( + serialized_name="azureStackHciCluster", + ) + platform.connected_cluster = AAZObjectType( + serialized_name="connectedCluster", + ) + platform.custom_location = AAZObjectType( + serialized_name="customLocation", + ) + platform.type = AAZStrType( + flags={"required": True}, + ) + + azure_stack_edge_devices = cls._schema_on_200.value.Element.properties.platform.azure_stack_edge_devices + azure_stack_edge_devices.Element = AAZObjectType() + _ListHelper._build_schema_azure_stack_edge_device_resource_id_read(azure_stack_edge_devices.Element) + + azure_stack_hci_cluster = cls._schema_on_200.value.Element.properties.platform.azure_stack_hci_cluster + azure_stack_hci_cluster.id = AAZStrType( + flags={"required": True}, + ) + + connected_cluster = cls._schema_on_200.value.Element.properties.platform.connected_cluster + connected_cluster.id = AAZStrType( + flags={"required": True}, + ) + + custom_location = cls._schema_on_200.value.Element.properties.platform.custom_location + custom_location.id = AAZStrType( + flags={"required": True}, + ) + + sites = cls._schema_on_200.value.Element.properties.sites + sites.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element.properties.sites.Element + _element.id = AAZStrType( + flags={"required": True}, + ) + + system_data = cls._schema_on_200.value.Element.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.value.Element.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _ListHelper: + """Helper class for List""" + + _schema_azure_stack_edge_device_resource_id_read = None + + @classmethod + def _build_schema_azure_stack_edge_device_resource_id_read(cls, _schema): + if cls._schema_azure_stack_edge_device_resource_id_read is not None: + _schema.id = cls._schema_azure_stack_edge_device_resource_id_read.id + return + + cls._schema_azure_stack_edge_device_resource_id_read = _schema_azure_stack_edge_device_resource_id_read = AAZObjectType() + + azure_stack_edge_device_resource_id_read = _schema_azure_stack_edge_device_resource_id_read + azure_stack_edge_device_resource_id_read.id = AAZStrType( + flags={"required": True}, + ) + + _schema.id = cls._schema_azure_stack_edge_device_resource_id_read.id + + +__all__ = ["List"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/_reinstall.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/_reinstall.py new file mode 100644 index 00000000000..31979e3ead7 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/_reinstall.py @@ -0,0 +1,254 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network pccp reinstall", +) +class Reinstall(AAZCommand): + """Reinstall the specified packet core control plane. This action will remove any transaction state from the packet core to return it to a known state. This action will cause a service outage. + + :example: Reinstall Packet Core Control Plane + az mobile-network pccp reinstall --pccp-name pccp-name -g rg + """ + + _aaz_info = { + "version": "2022-11-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/packetcorecontrolplanes/{}/reinstall", "2022-11-01"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.pccp_name = AAZStrArg( + options=["--pccp-name"], + help="The name of the packet core control plane.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + yield self.PacketCoreControlPlaneReinstall(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class PacketCoreControlPlaneReinstall(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/{packetCoreControlPlaneName}/reinstall", + **self.url_parameters + ) + + @property + def method(self): + return "POST" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "packetCoreControlPlaneName", self.ctx.args.pccp_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.end_time = AAZStrType( + serialized_name="endTime", + ) + _schema_on_200.error = AAZObjectType() + _ReinstallHelper._build_schema_error_detail_read(_schema_on_200.error) + _schema_on_200.id = AAZStrType() + _schema_on_200.name = AAZStrType() + _schema_on_200.percent_complete = AAZFloatType( + serialized_name="percentComplete", + ) + _schema_on_200.resource_id = AAZStrType( + serialized_name="resourceId", + ) + _schema_on_200.start_time = AAZStrType( + serialized_name="startTime", + ) + _schema_on_200.status = AAZStrType( + flags={"required": True}, + ) + + return cls._schema_on_200 + + +class _ReinstallHelper: + """Helper class for Reinstall""" + + _schema_error_detail_read = None + + @classmethod + def _build_schema_error_detail_read(cls, _schema): + if cls._schema_error_detail_read is not None: + _schema.additional_info = cls._schema_error_detail_read.additional_info + _schema.code = cls._schema_error_detail_read.code + _schema.details = cls._schema_error_detail_read.details + _schema.message = cls._schema_error_detail_read.message + _schema.target = cls._schema_error_detail_read.target + return + + cls._schema_error_detail_read = _schema_error_detail_read = AAZObjectType() + + error_detail_read = _schema_error_detail_read + error_detail_read.additional_info = AAZListType( + serialized_name="additionalInfo", + flags={"read_only": True}, + ) + error_detail_read.code = AAZStrType( + flags={"read_only": True}, + ) + error_detail_read.details = AAZListType( + flags={"read_only": True}, + ) + error_detail_read.message = AAZStrType( + flags={"read_only": True}, + ) + error_detail_read.target = AAZStrType( + flags={"read_only": True}, + ) + + additional_info = _schema_error_detail_read.additional_info + additional_info.Element = AAZObjectType() + + _element = _schema_error_detail_read.additional_info.Element + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + details = _schema_error_detail_read.details + details.Element = AAZObjectType() + cls._build_schema_error_detail_read(details.Element) + + _schema.additional_info = cls._schema_error_detail_read.additional_info + _schema.code = cls._schema_error_detail_read.code + _schema.details = cls._schema_error_detail_read.details + _schema.message = cls._schema_error_detail_read.message + _schema.target = cls._schema_error_detail_read.target + + +__all__ = ["Reinstall"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/_rollback.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/_rollback.py new file mode 100644 index 00000000000..4245e44cdb1 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/_rollback.py @@ -0,0 +1,254 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network pccp rollback", +) +class Rollback(AAZCommand): + """Roll back the specified packet core control plane to the previous version, "rollbackVersion". Multiple consecutive rollbacks are not possible. This action may cause a service outage. + + :example: Rollback Packet Core Control Plane + az mobile-network pccp rollback --pccp-name pccp-name -g rg + """ + + _aaz_info = { + "version": "2022-11-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/packetcorecontrolplanes/{}/rollback", "2022-11-01"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.pccp_name = AAZStrArg( + options=["--pccp-name"], + help="The name of the packet core control plane.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + yield self.PacketCoreControlPlaneRollback(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class PacketCoreControlPlaneRollback(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/{packetCoreControlPlaneName}/rollback", + **self.url_parameters + ) + + @property + def method(self): + return "POST" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "packetCoreControlPlaneName", self.ctx.args.pccp_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.end_time = AAZStrType( + serialized_name="endTime", + ) + _schema_on_200.error = AAZObjectType() + _RollbackHelper._build_schema_error_detail_read(_schema_on_200.error) + _schema_on_200.id = AAZStrType() + _schema_on_200.name = AAZStrType() + _schema_on_200.percent_complete = AAZFloatType( + serialized_name="percentComplete", + ) + _schema_on_200.resource_id = AAZStrType( + serialized_name="resourceId", + ) + _schema_on_200.start_time = AAZStrType( + serialized_name="startTime", + ) + _schema_on_200.status = AAZStrType( + flags={"required": True}, + ) + + return cls._schema_on_200 + + +class _RollbackHelper: + """Helper class for Rollback""" + + _schema_error_detail_read = None + + @classmethod + def _build_schema_error_detail_read(cls, _schema): + if cls._schema_error_detail_read is not None: + _schema.additional_info = cls._schema_error_detail_read.additional_info + _schema.code = cls._schema_error_detail_read.code + _schema.details = cls._schema_error_detail_read.details + _schema.message = cls._schema_error_detail_read.message + _schema.target = cls._schema_error_detail_read.target + return + + cls._schema_error_detail_read = _schema_error_detail_read = AAZObjectType() + + error_detail_read = _schema_error_detail_read + error_detail_read.additional_info = AAZListType( + serialized_name="additionalInfo", + flags={"read_only": True}, + ) + error_detail_read.code = AAZStrType( + flags={"read_only": True}, + ) + error_detail_read.details = AAZListType( + flags={"read_only": True}, + ) + error_detail_read.message = AAZStrType( + flags={"read_only": True}, + ) + error_detail_read.target = AAZStrType( + flags={"read_only": True}, + ) + + additional_info = _schema_error_detail_read.additional_info + additional_info.Element = AAZObjectType() + + _element = _schema_error_detail_read.additional_info.Element + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + details = _schema_error_detail_read.details + details.Element = AAZObjectType() + cls._build_schema_error_detail_read(details.Element) + + _schema.additional_info = cls._schema_error_detail_read.additional_info + _schema.code = cls._schema_error_detail_read.code + _schema.details = cls._schema_error_detail_read.details + _schema.message = cls._schema_error_detail_read.message + _schema.target = cls._schema_error_detail_read.target + + +__all__ = ["Rollback"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/_show.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/_show.py new file mode 100644 index 00000000000..1fe0603fad7 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/_show.py @@ -0,0 +1,387 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network pccp show", +) +class Show(AAZCommand): + """Get information about the specified packet core control plane. + + :example: Show Packet Core Control Plane + az mobile-network pccp show -n pccp-name -g rg + """ + + _aaz_info = { + "version": "2022-11-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/packetcorecontrolplanes/{}", "2022-11-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.pccp_name = AAZStrArg( + options=["-n", "--name", "--pccp-name"], + help="The name of the packet core control plane.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.PacketCoreControlPlanesGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class PacketCoreControlPlanesGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/{packetCoreControlPlaneName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "packetCoreControlPlaneName", self.ctx.args.pccp_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.identity = AAZObjectType() + _schema_on_200.location = AAZStrType( + flags={"required": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType( + flags={"required": True, "client_flatten": True}, + ) + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + identity = cls._schema_on_200.identity + identity.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + identity.tenant_id = AAZStrType( + serialized_name="tenantId", + flags={"read_only": True}, + ) + identity.type = AAZStrType( + flags={"required": True}, + ) + identity.user_assigned_identities = AAZDictType( + serialized_name="userAssignedIdentities", + ) + + user_assigned_identities = cls._schema_on_200.identity.user_assigned_identities + user_assigned_identities.Element = AAZObjectType() + + _element = cls._schema_on_200.identity.user_assigned_identities.Element + _element.client_id = AAZStrType( + serialized_name="clientId", + flags={"read_only": True}, + ) + _element.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.control_plane_access_interface = AAZObjectType( + serialized_name="controlPlaneAccessInterface", + flags={"required": True}, + ) + properties.core_network_technology = AAZStrType( + serialized_name="coreNetworkTechnology", + ) + properties.installation = AAZObjectType() + properties.local_diagnostics_access = AAZObjectType( + serialized_name="localDiagnosticsAccess", + flags={"required": True}, + ) + properties.platform = AAZObjectType( + flags={"required": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.rollback_version = AAZStrType( + serialized_name="rollbackVersion", + flags={"read_only": True}, + ) + properties.sites = AAZListType( + flags={"required": True}, + ) + properties.sku = AAZStrType( + flags={"required": True}, + ) + properties.ue_mtu = AAZIntType( + serialized_name="ueMtu", + ) + properties.version = AAZStrType() + + control_plane_access_interface = cls._schema_on_200.properties.control_plane_access_interface + control_plane_access_interface.ipv4_address = AAZStrType( + serialized_name="ipv4Address", + ) + control_plane_access_interface.ipv4_gateway = AAZStrType( + serialized_name="ipv4Gateway", + ) + control_plane_access_interface.ipv4_subnet = AAZStrType( + serialized_name="ipv4Subnet", + ) + control_plane_access_interface.name = AAZStrType() + + installation = cls._schema_on_200.properties.installation + installation.operation = AAZObjectType() + installation.state = AAZStrType() + + operation = cls._schema_on_200.properties.installation.operation + operation.id = AAZStrType( + flags={"required": True}, + ) + + local_diagnostics_access = cls._schema_on_200.properties.local_diagnostics_access + local_diagnostics_access.authentication_type = AAZStrType( + serialized_name="authenticationType", + flags={"required": True}, + ) + local_diagnostics_access.https_server_certificate = AAZObjectType( + serialized_name="httpsServerCertificate", + ) + + https_server_certificate = cls._schema_on_200.properties.local_diagnostics_access.https_server_certificate + https_server_certificate.certificate_url = AAZStrType( + serialized_name="certificateUrl", + flags={"required": True}, + ) + https_server_certificate.provisioning = AAZObjectType() + + provisioning = cls._schema_on_200.properties.local_diagnostics_access.https_server_certificate.provisioning + provisioning.reason = AAZStrType( + flags={"read_only": True}, + ) + provisioning.state = AAZStrType( + flags={"read_only": True}, + ) + + platform = cls._schema_on_200.properties.platform + platform.azure_stack_edge_device = AAZObjectType( + serialized_name="azureStackEdgeDevice", + ) + _ShowHelper._build_schema_azure_stack_edge_device_resource_id_read(platform.azure_stack_edge_device) + platform.azure_stack_edge_devices = AAZListType( + serialized_name="azureStackEdgeDevices", + flags={"read_only": True}, + ) + platform.azure_stack_hci_cluster = AAZObjectType( + serialized_name="azureStackHciCluster", + ) + platform.connected_cluster = AAZObjectType( + serialized_name="connectedCluster", + ) + platform.custom_location = AAZObjectType( + serialized_name="customLocation", + ) + platform.type = AAZStrType( + flags={"required": True}, + ) + + azure_stack_edge_devices = cls._schema_on_200.properties.platform.azure_stack_edge_devices + azure_stack_edge_devices.Element = AAZObjectType() + _ShowHelper._build_schema_azure_stack_edge_device_resource_id_read(azure_stack_edge_devices.Element) + + azure_stack_hci_cluster = cls._schema_on_200.properties.platform.azure_stack_hci_cluster + azure_stack_hci_cluster.id = AAZStrType( + flags={"required": True}, + ) + + connected_cluster = cls._schema_on_200.properties.platform.connected_cluster + connected_cluster.id = AAZStrType( + flags={"required": True}, + ) + + custom_location = cls._schema_on_200.properties.platform.custom_location + custom_location.id = AAZStrType( + flags={"required": True}, + ) + + sites = cls._schema_on_200.properties.sites + sites.Element = AAZObjectType() + + _element = cls._schema_on_200.properties.sites.Element + _element.id = AAZStrType( + flags={"required": True}, + ) + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _ShowHelper: + """Helper class for Show""" + + _schema_azure_stack_edge_device_resource_id_read = None + + @classmethod + def _build_schema_azure_stack_edge_device_resource_id_read(cls, _schema): + if cls._schema_azure_stack_edge_device_resource_id_read is not None: + _schema.id = cls._schema_azure_stack_edge_device_resource_id_read.id + return + + cls._schema_azure_stack_edge_device_resource_id_read = _schema_azure_stack_edge_device_resource_id_read = AAZObjectType() + + azure_stack_edge_device_resource_id_read = _schema_azure_stack_edge_device_resource_id_read + azure_stack_edge_device_resource_id_read.id = AAZStrType( + flags={"required": True}, + ) + + _schema.id = cls._schema_azure_stack_edge_device_resource_id_read.id + + +__all__ = ["Show"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/_update.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/_update.py new file mode 100644 index 00000000000..c2bfe37c39b --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/_update.py @@ -0,0 +1,859 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network pccp update", +) +class Update(AAZCommand): + """Update a packet core control plane. + + :example: Update Packet Core Control Plane tags + az mobile-network pccp update -n pccp-name -g rg --ue-mtu 1500 --tags "{tag:test,tag2:test2}" + """ + + _aaz_info = { + "version": "2022-11-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/packetcorecontrolplanes/{}", "2022-11-01"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + AZ_SUPPORT_GENERIC_UPDATE = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.pccp_name = AAZStrArg( + options=["-n", "--name", "--pccp-name"], + help="The name of the packet core control plane.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + + # define Arg Group "Parameters" + + _args_schema = cls._args_schema + _args_schema.identity = AAZObjectArg( + options=["--identity"], + arg_group="Parameters", + help="The identity used to retrieve the ingress certificate from Azure key vault.", + nullable=True, + ) + _args_schema.tags = AAZDictArg( + options=["--tags"], + arg_group="Parameters", + help="Resource tags.", + nullable=True, + ) + + identity = cls._args_schema.identity + identity.type = AAZStrArg( + options=["type"], + help="Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).", + enum={"None": "None", "SystemAssigned": "SystemAssigned", "SystemAssigned,UserAssigned": "SystemAssigned,UserAssigned", "UserAssigned": "UserAssigned"}, + ) + identity.user_assigned_identities = AAZDictArg( + options=["user-assigned-identities"], + help="The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests.", + nullable=True, + ) + + user_assigned_identities = cls._args_schema.identity.user_assigned_identities + user_assigned_identities.Element = AAZObjectArg( + nullable=True, + blank={}, + ) + + tags = cls._args_schema.tags + tags.Element = AAZStrArg( + nullable=True, + ) + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.access_interface = AAZObjectArg( + options=["--access-interface"], + arg_group="Properties", + help="The control plane interface on the access network. For 5G networks, this is the N2 interface. For 4G networks, this is the S1-MME interface.", + ) + _args_schema.core_network_tec = AAZStrArg( + options=["--core-network-tec"], + arg_group="Properties", + help="The core network technology generation (5G core or EPC / 4G core).", + nullable=True, + enum={"5GC": "5GC", "EPC": "EPC"}, + ) + _args_schema.local_diagnostics = AAZObjectArg( + options=["--local-diagnostics"], + arg_group="Properties", + help="The kubernetes ingress configuration to control access to packet core diagnostics over local APIs.", + ) + _args_schema.platform = AAZObjectArg( + options=["--platform"], + arg_group="Properties", + help="The platform where the packet core is deployed.", + ) + _args_schema.sites = AAZListArg( + options=["--sites"], + arg_group="Properties", + help="Site(s) under which this packet core control plane should be deployed. The sites must be in the same location as the packet core control plane.", + fmt=AAZListArgFormat( + unique=True, + ), + ) + _args_schema.sku = AAZStrArg( + options=["--sku"], + arg_group="Properties", + help="The SKU defining the throughput and SIM allowances for this packet core control plane deployment.", + enum={"G0": "G0", "G1": "G1", "G10": "G10", "G2": "G2", "G3": "G3", "G4": "G4", "G5": "G5"}, + ) + _args_schema.ue_mtu = AAZIntArg( + options=["--ue-mtu"], + arg_group="Properties", + help="The MTU (in bytes) signaled to the UE. The same MTU is set on the user plane data links for all data networks. The MTU set on the user plane access link is calculated to be 60 bytes greater than this value to allow for GTP encapsulation.", + nullable=True, + fmt=AAZIntArgFormat( + maximum=1930, + minimum=1280, + ), + ) + _args_schema.version = AAZStrArg( + options=["--version"], + arg_group="Properties", + help="The version of the packet core software that is deployed.", + nullable=True, + ) + + access_interface = cls._args_schema.access_interface + access_interface.ipv4_address = AAZStrArg( + options=["ipv4-address"], + help="The IPv4 address.", + nullable=True, + fmt=AAZStrArgFormat( + pattern="^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$", + ), + ) + access_interface.ipv4_gateway = AAZStrArg( + options=["ipv4-gateway"], + help="The default IPv4 gateway (router).", + nullable=True, + fmt=AAZStrArgFormat( + pattern="^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$", + ), + ) + access_interface.ipv4_subnet = AAZStrArg( + options=["ipv4-subnet"], + help="The IPv4 subnet.", + nullable=True, + fmt=AAZStrArgFormat( + pattern="^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$", + ), + ) + access_interface.name = AAZStrArg( + options=["name"], + help="The logical name for this interface. This should match one of the interfaces configured on your Azure Stack Edge device.", + nullable=True, + ) + + local_diagnostics = cls._args_schema.local_diagnostics + local_diagnostics.authentication_type = AAZStrArg( + options=["authentication-type"], + help="How to authenticate users who access local diagnostics APIs.", + enum={"AAD": "AAD", "Password": "Password"}, + ) + local_diagnostics.https_server_certificate = AAZObjectArg( + options=["https-server-certificate"], + help="The HTTPS server TLS certificate used to secure local access to diagnostics.", + nullable=True, + ) + + https_server_certificate = cls._args_schema.local_diagnostics.https_server_certificate + https_server_certificate.certificate_url = AAZStrArg( + options=["certificate-url"], + help="The certificate URL, unversioned. For example: https://contosovault.vault.azure.net/certificates/ingress.", + ) + + platform = cls._args_schema.platform + platform.azure_stack_edge_device = AAZObjectArg( + options=["azure-stack-edge-device"], + help="The Azure Stack Edge device where where the packet core is deployed. If the device is part of a fault tolerant pair, either device in the pair can be specified.", + nullable=True, + ) + platform.azure_stack_hci_cluster = AAZObjectArg( + options=["azure-stack-hci-cluster"], + help="The Azure Stack HCI cluster where the packet core is deployed.", + nullable=True, + ) + platform.connected_cluster = AAZObjectArg( + options=["connected-cluster"], + help="Azure Arc connected cluster where the packet core is deployed.", + nullable=True, + ) + platform.custom_location = AAZObjectArg( + options=["custom-location"], + help="Azure Arc custom location where the packet core is deployed.", + nullable=True, + ) + platform.type = AAZStrArg( + options=["type"], + help="The platform type where packet core is deployed.", + enum={"3P-AZURE-STACK-HCI": "3P-AZURE-STACK-HCI", "AKS-HCI": "AKS-HCI"}, + ) + + azure_stack_edge_device = cls._args_schema.platform.azure_stack_edge_device + azure_stack_edge_device.id = AAZStrArg( + options=["id"], + help="Azure Stack Edge device resource ID.", + fmt=AAZStrArgFormat( + pattern="^/[sS][uU][bB][sS][cC][rR][iI][pP][tT][iI][oO][nN][sS]/[^/?#]+/[rR][eE][sS][oO][uU][rR][cC][eE][gG][rR][oO][uU][pP][sS]/[^/?#]+/[pP][rR][oO][vV][iI][dD][eE][rR][sS]/[mM][iI][cC][rR][oO][sS][oO][fF][tT]\.[dD][aA][tT][aA][bB][oO][xX][eE][dD][gG][eE]/[dD][aA][tT][aA][bB][oO][xX][eE][dD][gG][eE][dD][eE][vV][iI][cC][eE][sS]/[^/?#]+$", + ), + ) + + azure_stack_hci_cluster = cls._args_schema.platform.azure_stack_hci_cluster + azure_stack_hci_cluster.id = AAZStrArg( + options=["id"], + help="Azure Stack HCI cluster resource ID.", + fmt=AAZStrArgFormat( + pattern="^/[sS][uU][bB][sS][cC][rR][iI][pP][tT][iI][oO][nN][sS]/[^/?#]+/[rR][eE][sS][oO][uU][rR][cC][eE][gG][rR][oO][uU][pP][sS]/[^/?#]+/[pP][rR][oO][vV][iI][dD][eE][rR][sS]/[mM][iI][cC][rR][oO][sS][oO][fF][tT]\.[aA][zZ][uU][rR][eE][sS][tT][aA][cC][kK][hH][cC][iI]/[cC][lL][uU][sS][tT][eE][rR][sS]/[^/?#]+$", + ), + ) + + connected_cluster = cls._args_schema.platform.connected_cluster + connected_cluster.id = AAZStrArg( + options=["id"], + help="Azure Arc connected cluster resource ID.", + fmt=AAZStrArgFormat( + pattern="^/[sS][uU][bB][sS][cC][rR][iI][pP][tT][iI][oO][nN][sS]/[^/?#]+/[rR][eE][sS][oO][uU][rR][cC][eE][gG][rR][oO][uU][pP][sS]/[^/?#]+/[pP][rR][oO][vV][iI][dD][eE][rR][sS]/[mM][iI][cC][rR][oO][sS][oO][fF][tT]\.[kK][uU][bB][eE][rR][nN][eE][tT][eE][sS]/[cC][oO][nN][nN][eE][cC][tT][eE][dD][cC][lL][uU][sS][tT][eE][rR][sS]/[^/?#]+$", + ), + ) + + custom_location = cls._args_schema.platform.custom_location + custom_location.id = AAZStrArg( + options=["id"], + help="Azure Arc custom location resource ID.", + fmt=AAZStrArgFormat( + pattern="^/[sS][uU][bB][sS][cC][rR][iI][pP][tT][iI][oO][nN][sS]/[^/?#]+/[rR][eE][sS][oO][uU][rR][cC][eE][gG][rR][oO][uU][pP][sS]/[^/?#]+/[pP][rR][oO][vV][iI][dD][eE][rR][sS]/[mM][iI][cC][rR][oO][sS][oO][fF][tT]\.[eE][xX][tT][eE][nN][dD][eE][dD][lL][oO][cC][aA][tT][iI][oO][nN]/[cC][uU][sS][tT][oO][mM][lL][oO][cC][aA][tT][iI][oO][nN][sS]/[^/?#]+$", + ), + ) + + sites = cls._args_schema.sites + sites.Element = AAZObjectArg( + nullable=True, + ) + + _element = cls._args_schema.sites.Element + _element.id = AAZStrArg( + options=["id"], + help="Site resource ID.", + fmt=AAZStrArgFormat( + pattern="^/[sS][uU][bB][sS][cC][rR][iI][pP][tT][iI][oO][nN][sS]/[^/?#]+/[rR][eE][sS][oO][uU][rR][cC][eE][gG][rR][oO][uU][pP][sS]/[^/?#]+/[pP][rR][oO][vV][iI][dD][eE][rR][sS]/[mM][iI][cC][rR][oO][sS][oO][fF][tT]\.[mM][oO][bB][iI][lL][eE][nN][eE][tT][wW][oO][rR][kK]/[mM][oO][bB][iI][lL][eE][nN][eE][tT][wW][oO][rR][kK][sS]/[^/?#]+/[sS][iI][tT][eE][sS]/[^/?#]+$", + ), + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.PacketCoreControlPlanesGet(ctx=self.ctx)() + self.pre_instance_update(self.ctx.vars.instance) + self.InstanceUpdateByJson(ctx=self.ctx)() + self.InstanceUpdateByGeneric(ctx=self.ctx)() + self.post_instance_update(self.ctx.vars.instance) + yield self.PacketCoreControlPlanesCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + @register_callback + def pre_instance_update(self, instance): + pass + + @register_callback + def post_instance_update(self, instance): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class PacketCoreControlPlanesGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/{packetCoreControlPlaneName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "packetCoreControlPlaneName", self.ctx.args.pccp_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + _UpdateHelper._build_schema_packet_core_control_plane_read(cls._schema_on_200) + + return cls._schema_on_200 + + class PacketCoreControlPlanesCreateOrUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200, 201]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/{packetCoreControlPlaneName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "packetCoreControlPlaneName", self.ctx.args.pccp_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + value=self.ctx.vars.instance, + ) + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + _UpdateHelper._build_schema_packet_core_control_plane_read(cls._schema_on_200_201) + + return cls._schema_on_200_201 + + class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): + + def __call__(self, *args, **kwargs): + self._update_instance(self.ctx.vars.instance) + + def _update_instance(self, instance): + _instance_value, _builder = self.new_content_builder( + self.ctx.args, + value=instance, + typ=AAZObjectType + ) + _builder.set_prop("identity", AAZObjectType, ".identity") + _builder.set_prop("properties", AAZObjectType, ".", typ_kwargs={"flags": {"required": True, "client_flatten": True}}) + _builder.set_prop("tags", AAZDictType, ".tags") + + identity = _builder.get(".identity") + if identity is not None: + identity.set_prop("type", AAZStrType, ".type", typ_kwargs={"flags": {"required": True}}) + identity.set_prop("userAssignedIdentities", AAZDictType, ".user_assigned_identities") + + user_assigned_identities = _builder.get(".identity.userAssignedIdentities") + if user_assigned_identities is not None: + user_assigned_identities.set_elements(AAZObjectType, ".") + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("controlPlaneAccessInterface", AAZObjectType, ".access_interface", typ_kwargs={"flags": {"required": True}}) + properties.set_prop("coreNetworkTechnology", AAZStrType, ".core_network_tec") + properties.set_prop("localDiagnosticsAccess", AAZObjectType, ".local_diagnostics", typ_kwargs={"flags": {"required": True}}) + properties.set_prop("platform", AAZObjectType, ".platform", typ_kwargs={"flags": {"required": True}}) + properties.set_prop("sites", AAZListType, ".sites", typ_kwargs={"flags": {"required": True}}) + properties.set_prop("sku", AAZStrType, ".sku", typ_kwargs={"flags": {"required": True}}) + properties.set_prop("ueMtu", AAZIntType, ".ue_mtu") + properties.set_prop("version", AAZStrType, ".version") + + control_plane_access_interface = _builder.get(".properties.controlPlaneAccessInterface") + if control_plane_access_interface is not None: + control_plane_access_interface.set_prop("ipv4Address", AAZStrType, ".ipv4_address") + control_plane_access_interface.set_prop("ipv4Gateway", AAZStrType, ".ipv4_gateway") + control_plane_access_interface.set_prop("ipv4Subnet", AAZStrType, ".ipv4_subnet") + control_plane_access_interface.set_prop("name", AAZStrType, ".name") + + local_diagnostics_access = _builder.get(".properties.localDiagnosticsAccess") + if local_diagnostics_access is not None: + local_diagnostics_access.set_prop("authenticationType", AAZStrType, ".authentication_type", typ_kwargs={"flags": {"required": True}}) + local_diagnostics_access.set_prop("httpsServerCertificate", AAZObjectType, ".https_server_certificate") + + https_server_certificate = _builder.get(".properties.localDiagnosticsAccess.httpsServerCertificate") + if https_server_certificate is not None: + https_server_certificate.set_prop("certificateUrl", AAZStrType, ".certificate_url", typ_kwargs={"flags": {"required": True}}) + + platform = _builder.get(".properties.platform") + if platform is not None: + platform.set_prop("azureStackEdgeDevice", AAZObjectType, ".azure_stack_edge_device") + platform.set_prop("azureStackHciCluster", AAZObjectType, ".azure_stack_hci_cluster") + platform.set_prop("connectedCluster", AAZObjectType, ".connected_cluster") + platform.set_prop("customLocation", AAZObjectType, ".custom_location") + platform.set_prop("type", AAZStrType, ".type", typ_kwargs={"flags": {"required": True}}) + + azure_stack_edge_device = _builder.get(".properties.platform.azureStackEdgeDevice") + if azure_stack_edge_device is not None: + azure_stack_edge_device.set_prop("id", AAZStrType, ".id", typ_kwargs={"flags": {"required": True}}) + + azure_stack_hci_cluster = _builder.get(".properties.platform.azureStackHciCluster") + if azure_stack_hci_cluster is not None: + azure_stack_hci_cluster.set_prop("id", AAZStrType, ".id", typ_kwargs={"flags": {"required": True}}) + + connected_cluster = _builder.get(".properties.platform.connectedCluster") + if connected_cluster is not None: + connected_cluster.set_prop("id", AAZStrType, ".id", typ_kwargs={"flags": {"required": True}}) + + custom_location = _builder.get(".properties.platform.customLocation") + if custom_location is not None: + custom_location.set_prop("id", AAZStrType, ".id", typ_kwargs={"flags": {"required": True}}) + + sites = _builder.get(".properties.sites") + if sites is not None: + sites.set_elements(AAZObjectType, ".") + + _elements = _builder.get(".properties.sites[]") + if _elements is not None: + _elements.set_prop("id", AAZStrType, ".id", typ_kwargs={"flags": {"required": True}}) + + tags = _builder.get(".tags") + if tags is not None: + tags.set_elements(AAZStrType, ".") + + return _instance_value + + class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): + + def __call__(self, *args, **kwargs): + self._update_instance_by_generic( + self.ctx.vars.instance, + self.ctx.generic_update_args + ) + + +class _UpdateHelper: + """Helper class for Update""" + + _schema_azure_stack_edge_device_resource_id_read = None + + @classmethod + def _build_schema_azure_stack_edge_device_resource_id_read(cls, _schema): + if cls._schema_azure_stack_edge_device_resource_id_read is not None: + _schema.id = cls._schema_azure_stack_edge_device_resource_id_read.id + return + + cls._schema_azure_stack_edge_device_resource_id_read = _schema_azure_stack_edge_device_resource_id_read = AAZObjectType() + + azure_stack_edge_device_resource_id_read = _schema_azure_stack_edge_device_resource_id_read + azure_stack_edge_device_resource_id_read.id = AAZStrType( + flags={"required": True}, + ) + + _schema.id = cls._schema_azure_stack_edge_device_resource_id_read.id + + _schema_packet_core_control_plane_read = None + + @classmethod + def _build_schema_packet_core_control_plane_read(cls, _schema): + if cls._schema_packet_core_control_plane_read is not None: + _schema.id = cls._schema_packet_core_control_plane_read.id + _schema.identity = cls._schema_packet_core_control_plane_read.identity + _schema.location = cls._schema_packet_core_control_plane_read.location + _schema.name = cls._schema_packet_core_control_plane_read.name + _schema.properties = cls._schema_packet_core_control_plane_read.properties + _schema.system_data = cls._schema_packet_core_control_plane_read.system_data + _schema.tags = cls._schema_packet_core_control_plane_read.tags + _schema.type = cls._schema_packet_core_control_plane_read.type + return + + cls._schema_packet_core_control_plane_read = _schema_packet_core_control_plane_read = AAZObjectType() + + packet_core_control_plane_read = _schema_packet_core_control_plane_read + packet_core_control_plane_read.id = AAZStrType( + flags={"read_only": True}, + ) + packet_core_control_plane_read.identity = AAZObjectType() + packet_core_control_plane_read.location = AAZStrType( + flags={"required": True}, + ) + packet_core_control_plane_read.name = AAZStrType( + flags={"read_only": True}, + ) + packet_core_control_plane_read.properties = AAZObjectType( + flags={"required": True, "client_flatten": True}, + ) + packet_core_control_plane_read.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + packet_core_control_plane_read.tags = AAZDictType() + packet_core_control_plane_read.type = AAZStrType( + flags={"read_only": True}, + ) + + identity = _schema_packet_core_control_plane_read.identity + identity.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + identity.tenant_id = AAZStrType( + serialized_name="tenantId", + flags={"read_only": True}, + ) + identity.type = AAZStrType( + flags={"required": True}, + ) + identity.user_assigned_identities = AAZDictType( + serialized_name="userAssignedIdentities", + ) + + user_assigned_identities = _schema_packet_core_control_plane_read.identity.user_assigned_identities + user_assigned_identities.Element = AAZObjectType() + + _element = _schema_packet_core_control_plane_read.identity.user_assigned_identities.Element + _element.client_id = AAZStrType( + serialized_name="clientId", + flags={"read_only": True}, + ) + _element.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + + properties = _schema_packet_core_control_plane_read.properties + properties.control_plane_access_interface = AAZObjectType( + serialized_name="controlPlaneAccessInterface", + flags={"required": True}, + ) + properties.core_network_technology = AAZStrType( + serialized_name="coreNetworkTechnology", + ) + properties.installation = AAZObjectType() + properties.local_diagnostics_access = AAZObjectType( + serialized_name="localDiagnosticsAccess", + flags={"required": True}, + ) + properties.platform = AAZObjectType( + flags={"required": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.rollback_version = AAZStrType( + serialized_name="rollbackVersion", + flags={"read_only": True}, + ) + properties.sites = AAZListType( + flags={"required": True}, + ) + properties.sku = AAZStrType( + flags={"required": True}, + ) + properties.ue_mtu = AAZIntType( + serialized_name="ueMtu", + ) + properties.version = AAZStrType() + + control_plane_access_interface = _schema_packet_core_control_plane_read.properties.control_plane_access_interface + control_plane_access_interface.ipv4_address = AAZStrType( + serialized_name="ipv4Address", + ) + control_plane_access_interface.ipv4_gateway = AAZStrType( + serialized_name="ipv4Gateway", + ) + control_plane_access_interface.ipv4_subnet = AAZStrType( + serialized_name="ipv4Subnet", + ) + control_plane_access_interface.name = AAZStrType() + + installation = _schema_packet_core_control_plane_read.properties.installation + installation.operation = AAZObjectType() + installation.state = AAZStrType() + + operation = _schema_packet_core_control_plane_read.properties.installation.operation + operation.id = AAZStrType( + flags={"required": True}, + ) + + local_diagnostics_access = _schema_packet_core_control_plane_read.properties.local_diagnostics_access + local_diagnostics_access.authentication_type = AAZStrType( + serialized_name="authenticationType", + flags={"required": True}, + ) + local_diagnostics_access.https_server_certificate = AAZObjectType( + serialized_name="httpsServerCertificate", + ) + + https_server_certificate = _schema_packet_core_control_plane_read.properties.local_diagnostics_access.https_server_certificate + https_server_certificate.certificate_url = AAZStrType( + serialized_name="certificateUrl", + flags={"required": True}, + ) + https_server_certificate.provisioning = AAZObjectType() + + provisioning = _schema_packet_core_control_plane_read.properties.local_diagnostics_access.https_server_certificate.provisioning + provisioning.reason = AAZStrType( + flags={"read_only": True}, + ) + provisioning.state = AAZStrType( + flags={"read_only": True}, + ) + + platform = _schema_packet_core_control_plane_read.properties.platform + platform.azure_stack_edge_device = AAZObjectType( + serialized_name="azureStackEdgeDevice", + ) + cls._build_schema_azure_stack_edge_device_resource_id_read(platform.azure_stack_edge_device) + platform.azure_stack_edge_devices = AAZListType( + serialized_name="azureStackEdgeDevices", + flags={"read_only": True}, + ) + platform.azure_stack_hci_cluster = AAZObjectType( + serialized_name="azureStackHciCluster", + ) + platform.connected_cluster = AAZObjectType( + serialized_name="connectedCluster", + ) + platform.custom_location = AAZObjectType( + serialized_name="customLocation", + ) + platform.type = AAZStrType( + flags={"required": True}, + ) + + azure_stack_edge_devices = _schema_packet_core_control_plane_read.properties.platform.azure_stack_edge_devices + azure_stack_edge_devices.Element = AAZObjectType() + cls._build_schema_azure_stack_edge_device_resource_id_read(azure_stack_edge_devices.Element) + + azure_stack_hci_cluster = _schema_packet_core_control_plane_read.properties.platform.azure_stack_hci_cluster + azure_stack_hci_cluster.id = AAZStrType( + flags={"required": True}, + ) + + connected_cluster = _schema_packet_core_control_plane_read.properties.platform.connected_cluster + connected_cluster.id = AAZStrType( + flags={"required": True}, + ) + + custom_location = _schema_packet_core_control_plane_read.properties.platform.custom_location + custom_location.id = AAZStrType( + flags={"required": True}, + ) + + sites = _schema_packet_core_control_plane_read.properties.sites + sites.Element = AAZObjectType() + + _element = _schema_packet_core_control_plane_read.properties.sites.Element + _element.id = AAZStrType( + flags={"required": True}, + ) + + system_data = _schema_packet_core_control_plane_read.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = _schema_packet_core_control_plane_read.tags + tags.Element = AAZStrType() + + _schema.id = cls._schema_packet_core_control_plane_read.id + _schema.identity = cls._schema_packet_core_control_plane_read.identity + _schema.location = cls._schema_packet_core_control_plane_read.location + _schema.name = cls._schema_packet_core_control_plane_read.name + _schema.properties = cls._schema_packet_core_control_plane_read.properties + _schema.system_data = cls._schema_packet_core_control_plane_read.system_data + _schema.tags = cls._schema_packet_core_control_plane_read.tags + _schema.type = cls._schema_packet_core_control_plane_read.type + + +__all__ = ["Update"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/_wait.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/_wait.py new file mode 100644 index 00000000000..11219a9a006 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/_wait.py @@ -0,0 +1,383 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network pccp wait", +) +class Wait(AAZWaitCommand): + """Place the CLI in a waiting state until a condition is met. + """ + + _aaz_info = { + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/packetcorecontrolplanes/{}", "2022-11-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.pccp_name = AAZStrArg( + options=["-n", "--name", "--pccp-name"], + help="The name of the packet core control plane.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.PacketCoreControlPlanesGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) + return result + + class PacketCoreControlPlanesGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/{packetCoreControlPlaneName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "packetCoreControlPlaneName", self.ctx.args.pccp_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.identity = AAZObjectType() + _schema_on_200.location = AAZStrType( + flags={"required": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType( + flags={"required": True, "client_flatten": True}, + ) + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + identity = cls._schema_on_200.identity + identity.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + identity.tenant_id = AAZStrType( + serialized_name="tenantId", + flags={"read_only": True}, + ) + identity.type = AAZStrType( + flags={"required": True}, + ) + identity.user_assigned_identities = AAZDictType( + serialized_name="userAssignedIdentities", + ) + + user_assigned_identities = cls._schema_on_200.identity.user_assigned_identities + user_assigned_identities.Element = AAZObjectType() + + _element = cls._schema_on_200.identity.user_assigned_identities.Element + _element.client_id = AAZStrType( + serialized_name="clientId", + flags={"read_only": True}, + ) + _element.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.control_plane_access_interface = AAZObjectType( + serialized_name="controlPlaneAccessInterface", + flags={"required": True}, + ) + properties.core_network_technology = AAZStrType( + serialized_name="coreNetworkTechnology", + ) + properties.installation = AAZObjectType() + properties.local_diagnostics_access = AAZObjectType( + serialized_name="localDiagnosticsAccess", + flags={"required": True}, + ) + properties.platform = AAZObjectType( + flags={"required": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.rollback_version = AAZStrType( + serialized_name="rollbackVersion", + flags={"read_only": True}, + ) + properties.sites = AAZListType( + flags={"required": True}, + ) + properties.sku = AAZStrType( + flags={"required": True}, + ) + properties.ue_mtu = AAZIntType( + serialized_name="ueMtu", + ) + properties.version = AAZStrType() + + control_plane_access_interface = cls._schema_on_200.properties.control_plane_access_interface + control_plane_access_interface.ipv4_address = AAZStrType( + serialized_name="ipv4Address", + ) + control_plane_access_interface.ipv4_gateway = AAZStrType( + serialized_name="ipv4Gateway", + ) + control_plane_access_interface.ipv4_subnet = AAZStrType( + serialized_name="ipv4Subnet", + ) + control_plane_access_interface.name = AAZStrType() + + installation = cls._schema_on_200.properties.installation + installation.operation = AAZObjectType() + installation.state = AAZStrType() + + operation = cls._schema_on_200.properties.installation.operation + operation.id = AAZStrType( + flags={"required": True}, + ) + + local_diagnostics_access = cls._schema_on_200.properties.local_diagnostics_access + local_diagnostics_access.authentication_type = AAZStrType( + serialized_name="authenticationType", + flags={"required": True}, + ) + local_diagnostics_access.https_server_certificate = AAZObjectType( + serialized_name="httpsServerCertificate", + ) + + https_server_certificate = cls._schema_on_200.properties.local_diagnostics_access.https_server_certificate + https_server_certificate.certificate_url = AAZStrType( + serialized_name="certificateUrl", + flags={"required": True}, + ) + https_server_certificate.provisioning = AAZObjectType() + + provisioning = cls._schema_on_200.properties.local_diagnostics_access.https_server_certificate.provisioning + provisioning.reason = AAZStrType( + flags={"read_only": True}, + ) + provisioning.state = AAZStrType( + flags={"read_only": True}, + ) + + platform = cls._schema_on_200.properties.platform + platform.azure_stack_edge_device = AAZObjectType( + serialized_name="azureStackEdgeDevice", + ) + _WaitHelper._build_schema_azure_stack_edge_device_resource_id_read(platform.azure_stack_edge_device) + platform.azure_stack_edge_devices = AAZListType( + serialized_name="azureStackEdgeDevices", + flags={"read_only": True}, + ) + platform.azure_stack_hci_cluster = AAZObjectType( + serialized_name="azureStackHciCluster", + ) + platform.connected_cluster = AAZObjectType( + serialized_name="connectedCluster", + ) + platform.custom_location = AAZObjectType( + serialized_name="customLocation", + ) + platform.type = AAZStrType( + flags={"required": True}, + ) + + azure_stack_edge_devices = cls._schema_on_200.properties.platform.azure_stack_edge_devices + azure_stack_edge_devices.Element = AAZObjectType() + _WaitHelper._build_schema_azure_stack_edge_device_resource_id_read(azure_stack_edge_devices.Element) + + azure_stack_hci_cluster = cls._schema_on_200.properties.platform.azure_stack_hci_cluster + azure_stack_hci_cluster.id = AAZStrType( + flags={"required": True}, + ) + + connected_cluster = cls._schema_on_200.properties.platform.connected_cluster + connected_cluster.id = AAZStrType( + flags={"required": True}, + ) + + custom_location = cls._schema_on_200.properties.platform.custom_location + custom_location.id = AAZStrType( + flags={"required": True}, + ) + + sites = cls._schema_on_200.properties.sites + sites.Element = AAZObjectType() + + _element = cls._schema_on_200.properties.sites.Element + _element.id = AAZStrType( + flags={"required": True}, + ) + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _WaitHelper: + """Helper class for Wait""" + + _schema_azure_stack_edge_device_resource_id_read = None + + @classmethod + def _build_schema_azure_stack_edge_device_resource_id_read(cls, _schema): + if cls._schema_azure_stack_edge_device_resource_id_read is not None: + _schema.id = cls._schema_azure_stack_edge_device_resource_id_read.id + return + + cls._schema_azure_stack_edge_device_resource_id_read = _schema_azure_stack_edge_device_resource_id_read = AAZObjectType() + + azure_stack_edge_device_resource_id_read = _schema_azure_stack_edge_device_resource_id_read + azure_stack_edge_device_resource_id_read.id = AAZStrType( + flags={"required": True}, + ) + + _schema.id = cls._schema_azure_stack_edge_device_resource_id_read.id + + +__all__ = ["Wait"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/version/__cmd_group.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/version/__cmd_group.py new file mode 100644 index 00000000000..d02495eba80 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/version/__cmd_group.py @@ -0,0 +1,23 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command_group( + "mobile-network pccp version", +) +class __CMDGroup(AAZCommandGroup): + """Manage packet core control plane version + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/version/__init__.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/version/__init__.py new file mode 100644 index 00000000000..2df85698253 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/version/__init__.py @@ -0,0 +1,13 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * +from ._list import * +from ._show import * diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/version/_list.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/version/_list.py new file mode 100644 index 00000000000..e58f71aa174 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/version/_list.py @@ -0,0 +1,200 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network pccp version list", +) +class List(AAZCommand): + """List all supported packet core control planes versions. + + :example: List Packet Core Control Plane version + az mobile-network pccp version list + """ + + _aaz_info = { + "version": "2022-11-01", + "resources": [ + ["mgmt-plane", "/providers/microsoft.mobilenetwork/packetcorecontrolplaneversions", "2022-11-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_paging(self._execute_operations, self._output) + + def _execute_operations(self): + self.pre_operations() + self.PacketCoreControlPlaneVersionsList(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) + next_link = self.deserialize_output(self.ctx.vars.instance.next_link) + return result, next_link + + class PacketCoreControlPlaneVersionsList(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.next_link = AAZStrType( + serialized_name="nextLink", + flags={"read_only": True}, + ) + _schema_on_200.value = AAZListType() + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType( + flags={"required": True, "client_flatten": True}, + ) + _element.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.platforms = AAZListType() + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + platforms = cls._schema_on_200.value.Element.properties.platforms + platforms.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element.properties.platforms.Element + _element.maximum_platform_software_version = AAZStrType( + serialized_name="maximumPlatformSoftwareVersion", + ) + _element.minimum_platform_software_version = AAZStrType( + serialized_name="minimumPlatformSoftwareVersion", + ) + _element.obsolete_version = AAZStrType( + serialized_name="obsoleteVersion", + ) + _element.platform_type = AAZStrType( + serialized_name="platformType", + ) + _element.recommended_version = AAZStrType( + serialized_name="recommendedVersion", + ) + _element.version_state = AAZStrType( + serialized_name="versionState", + ) + + system_data = cls._schema_on_200.value.Element.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + return cls._schema_on_200 + + +class _ListHelper: + """Helper class for List""" + + +__all__ = ["List"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/version/_show.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/version/_show.py new file mode 100644 index 00000000000..37645b929bf --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/version/_show.py @@ -0,0 +1,218 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network pccp version show", +) +class Show(AAZCommand): + """Get information about the specified packet core control plane version. + + :example: Show Packet Core Control Plane version + az mobile-network pccp version show --version-name pmn-2211-0-80 + """ + + _aaz_info = { + "version": "2022-11-01", + "resources": [ + ["mgmt-plane", "/providers/microsoft.mobilenetwork/packetcorecontrolplaneversions/{}", "2022-11-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.version_name = AAZStrArg( + options=["--version-name"], + help="The name of the packet core control plane version.", + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.PacketCoreControlPlaneVersionsGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class PacketCoreControlPlaneVersionsGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/{versionName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "versionName", self.ctx.args.version_name, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType( + flags={"required": True, "client_flatten": True}, + ) + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.platforms = AAZListType() + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + platforms = cls._schema_on_200.properties.platforms + platforms.Element = AAZObjectType() + + _element = cls._schema_on_200.properties.platforms.Element + _element.maximum_platform_software_version = AAZStrType( + serialized_name="maximumPlatformSoftwareVersion", + ) + _element.minimum_platform_software_version = AAZStrType( + serialized_name="minimumPlatformSoftwareVersion", + ) + _element.obsolete_version = AAZStrType( + serialized_name="obsoleteVersion", + ) + _element.platform_type = AAZStrType( + serialized_name="platformType", + ) + _element.recommended_version = AAZStrType( + serialized_name="recommendedVersion", + ) + _element.version_state = AAZStrType( + serialized_name="versionState", + ) + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + return cls._schema_on_200 + + +class _ShowHelper: + """Helper class for Show""" + + +__all__ = ["Show"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pcdp/__cmd_group.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pcdp/__cmd_group.py new file mode 100644 index 00000000000..9ce3c80eb54 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pcdp/__cmd_group.py @@ -0,0 +1,23 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command_group( + "mobile-network pcdp", +) +class __CMDGroup(AAZCommandGroup): + """Manage packet core data plane + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pcdp/__init__.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pcdp/__init__.py new file mode 100644 index 00000000000..db73033039b --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pcdp/__init__.py @@ -0,0 +1,17 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * +from ._create import * +from ._delete import * +from ._list import * +from ._show import * +from ._update import * +from ._wait import * diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pcdp/_create.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pcdp/_create.py new file mode 100644 index 00000000000..2666c20a32e --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pcdp/_create.py @@ -0,0 +1,350 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network pcdp create", +) +class Create(AAZCommand): + """Create a packet core data plane. + + :example: Create Packet Core Data Plane + az mobile-network pcdp create -n pcdp-name -g rg --pccp-name pccp-name --access-interface "{name:N2,ipv4Address:10.28.128.2,ipv4Subnet:10.28.128.0/24,ipv4Gateway:10.28.128.1}" + """ + + _aaz_info = { + "version": "2022-11-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/packetcorecontrolplanes/{}/packetcoredataplanes/{}", "2022-11-01"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.pccp_name = AAZStrArg( + options=["--pccp-name"], + help="The name of the packet core control plane.", + required=True, + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.pcdp_name = AAZStrArg( + options=["-n", "--name", "--pcdp-name"], + help="The name of the packet core data plane.", + required=True, + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + + # define Arg Group "Parameters" + + _args_schema = cls._args_schema + _args_schema.location = AAZResourceLocationArg( + arg_group="Parameters", + help="The geo-location where the resource lives", + required=True, + fmt=AAZResourceLocationArgFormat( + resource_group_arg="resource_group", + ), + ) + _args_schema.tags = AAZDictArg( + options=["--tags"], + arg_group="Parameters", + help="Resource tags.", + ) + + tags = cls._args_schema.tags + tags.Element = AAZStrArg() + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.access_interface = AAZObjectArg( + options=["--access-interface"], + arg_group="Properties", + help="The user plane interface on the access network. For 5G networks, this is the N3 interface. For 4G networks, this is the S1-U interface.", + required=True, + ) + + access_interface = cls._args_schema.access_interface + access_interface.ipv4_address = AAZStrArg( + options=["ipv4-address"], + help="The IPv4 address.", + fmt=AAZStrArgFormat( + pattern="^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$", + ), + ) + access_interface.ipv4_gateway = AAZStrArg( + options=["ipv4-gateway"], + help="The default IPv4 gateway (router).", + fmt=AAZStrArgFormat( + pattern="^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$", + ), + ) + access_interface.ipv4_subnet = AAZStrArg( + options=["ipv4-subnet"], + help="The IPv4 subnet.", + fmt=AAZStrArgFormat( + pattern="^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$", + ), + ) + access_interface.name = AAZStrArg( + options=["name"], + help="The logical name for this interface. This should match one of the interfaces configured on your Azure Stack Edge device.", + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + yield self.PacketCoreDataPlanesCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class PacketCoreDataPlanesCreateOrUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200, 201]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/{packetCoreControlPlaneName}/packetCoreDataPlanes/{packetCoreDataPlaneName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "packetCoreControlPlaneName", self.ctx.args.pccp_name, + required=True, + ), + **self.serialize_url_param( + "packetCoreDataPlaneName", self.ctx.args.pcdp_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + typ=AAZObjectType, + typ_kwargs={"flags": {"required": True, "client_flatten": True}} + ) + _builder.set_prop("location", AAZStrType, ".location", typ_kwargs={"flags": {"required": True}}) + _builder.set_prop("properties", AAZObjectType, ".", typ_kwargs={"flags": {"required": True, "client_flatten": True}}) + _builder.set_prop("tags", AAZDictType, ".tags") + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("userPlaneAccessInterface", AAZObjectType, ".access_interface", typ_kwargs={"flags": {"required": True}}) + + user_plane_access_interface = _builder.get(".properties.userPlaneAccessInterface") + if user_plane_access_interface is not None: + user_plane_access_interface.set_prop("ipv4Address", AAZStrType, ".ipv4_address") + user_plane_access_interface.set_prop("ipv4Gateway", AAZStrType, ".ipv4_gateway") + user_plane_access_interface.set_prop("ipv4Subnet", AAZStrType, ".ipv4_subnet") + user_plane_access_interface.set_prop("name", AAZStrType, ".name") + + tags = _builder.get(".tags") + if tags is not None: + tags.set_elements(AAZStrType, ".") + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + + _schema_on_200_201 = cls._schema_on_200_201 + _schema_on_200_201.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.location = AAZStrType( + flags={"required": True}, + ) + _schema_on_200_201.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.properties = AAZObjectType( + flags={"required": True, "client_flatten": True}, + ) + _schema_on_200_201.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200_201.tags = AAZDictType() + _schema_on_200_201.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200_201.properties + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.user_plane_access_interface = AAZObjectType( + serialized_name="userPlaneAccessInterface", + flags={"required": True}, + ) + + user_plane_access_interface = cls._schema_on_200_201.properties.user_plane_access_interface + user_plane_access_interface.ipv4_address = AAZStrType( + serialized_name="ipv4Address", + ) + user_plane_access_interface.ipv4_gateway = AAZStrType( + serialized_name="ipv4Gateway", + ) + user_plane_access_interface.ipv4_subnet = AAZStrType( + serialized_name="ipv4Subnet", + ) + user_plane_access_interface.name = AAZStrType() + + system_data = cls._schema_on_200_201.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200_201.tags + tags.Element = AAZStrType() + + return cls._schema_on_200_201 + + +class _CreateHelper: + """Helper class for Create""" + + +__all__ = ["Create"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pcdp/_delete.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pcdp/_delete.py new file mode 100644 index 00000000000..a3be95656c1 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pcdp/_delete.py @@ -0,0 +1,181 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network pcdp delete", + confirmation="Are you sure you want to perform this operation?", +) +class Delete(AAZCommand): + """Delete the specified packet core data plane. + + :example: Delete Packet Core Data Plane + az mobile-network pcdp delete -g rg -n pcdp-name --pccp-name pccp-name -y + """ + + _aaz_info = { + "version": "2022-11-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/packetcorecontrolplanes/{}/packetcoredataplanes/{}", "2022-11-01"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, None) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.pccp_name = AAZStrArg( + options=["--pccp-name"], + help="The name of the packet core control plane.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.pcdp_name = AAZStrArg( + options=["-n", "--name", "--pcdp-name"], + help="The name of the packet core data plane.", + required=True, + id_part="child_name_1", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + yield self.PacketCoreDataPlanesDelete(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + class PacketCoreDataPlanesDelete(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [204]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_204, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/{packetCoreControlPlaneName}/packetCoreDataPlanes/{packetCoreDataPlaneName}", + **self.url_parameters + ) + + @property + def method(self): + return "DELETE" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "packetCoreControlPlaneName", self.ctx.args.pccp_name, + required=True, + ), + **self.serialize_url_param( + "packetCoreDataPlaneName", self.ctx.args.pcdp_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + def on_200(self, session): + pass + + def on_204(self, session): + pass + + +class _DeleteHelper: + """Helper class for Delete""" + + +__all__ = ["Delete"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pcdp/_list.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pcdp/_list.py new file mode 100644 index 00000000000..d2313a0bf57 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pcdp/_list.py @@ -0,0 +1,242 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network pcdp list", +) +class List(AAZCommand): + """List all the packet core data planes associated with a packet core control plane. + + :example: List Packet Core Data Plane by resource group + az mobile-network pcdp list -g rg --pccp-name pccp_name + """ + + _aaz_info = { + "version": "2022-11-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/packetcorecontrolplanes/{}/packetcoredataplanes", "2022-11-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_paging(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.pccp_name = AAZStrArg( + options=["--pccp-name"], + help="The name of the packet core control plane.", + required=True, + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.PacketCoreDataPlanesListByPacketCoreControlPlane(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) + next_link = self.deserialize_output(self.ctx.vars.instance.next_link) + return result, next_link + + class PacketCoreDataPlanesListByPacketCoreControlPlane(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/{packetCoreControlPlaneName}/packetCoreDataPlanes", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "packetCoreControlPlaneName", self.ctx.args.pccp_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.next_link = AAZStrType( + serialized_name="nextLink", + flags={"read_only": True}, + ) + _schema_on_200.value = AAZListType() + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.location = AAZStrType( + flags={"required": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType( + flags={"required": True, "client_flatten": True}, + ) + _element.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _element.tags = AAZDictType() + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.user_plane_access_interface = AAZObjectType( + serialized_name="userPlaneAccessInterface", + flags={"required": True}, + ) + + user_plane_access_interface = cls._schema_on_200.value.Element.properties.user_plane_access_interface + user_plane_access_interface.ipv4_address = AAZStrType( + serialized_name="ipv4Address", + ) + user_plane_access_interface.ipv4_gateway = AAZStrType( + serialized_name="ipv4Gateway", + ) + user_plane_access_interface.ipv4_subnet = AAZStrType( + serialized_name="ipv4Subnet", + ) + user_plane_access_interface.name = AAZStrType() + + system_data = cls._schema_on_200.value.Element.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.value.Element.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _ListHelper: + """Helper class for List""" + + +__all__ = ["List"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pcdp/_show.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pcdp/_show.py new file mode 100644 index 00000000000..073d1b67109 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pcdp/_show.py @@ -0,0 +1,247 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network pcdp show", +) +class Show(AAZCommand): + """Get information about the specified packet core data plane. + + :example: Show Packet Core Data Plane + az mobile-network pcdp show -g rg -n pcdp-name --pccp-name pccp-name + """ + + _aaz_info = { + "version": "2022-11-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/packetcorecontrolplanes/{}/packetcoredataplanes/{}", "2022-11-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.pccp_name = AAZStrArg( + options=["--pccp-name"], + help="The name of the packet core control plane.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.pcdp_name = AAZStrArg( + options=["-n", "--name", "--pcdp-name"], + help="The name of the packet core data plane.", + required=True, + id_part="child_name_1", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.PacketCoreDataPlanesGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class PacketCoreDataPlanesGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/{packetCoreControlPlaneName}/packetCoreDataPlanes/{packetCoreDataPlaneName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "packetCoreControlPlaneName", self.ctx.args.pccp_name, + required=True, + ), + **self.serialize_url_param( + "packetCoreDataPlaneName", self.ctx.args.pcdp_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.location = AAZStrType( + flags={"required": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType( + flags={"required": True, "client_flatten": True}, + ) + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.user_plane_access_interface = AAZObjectType( + serialized_name="userPlaneAccessInterface", + flags={"required": True}, + ) + + user_plane_access_interface = cls._schema_on_200.properties.user_plane_access_interface + user_plane_access_interface.ipv4_address = AAZStrType( + serialized_name="ipv4Address", + ) + user_plane_access_interface.ipv4_gateway = AAZStrType( + serialized_name="ipv4Gateway", + ) + user_plane_access_interface.ipv4_subnet = AAZStrType( + serialized_name="ipv4Subnet", + ) + user_plane_access_interface.name = AAZStrType() + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _ShowHelper: + """Helper class for Show""" + + +__all__ = ["Show"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pcdp/_update.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pcdp/_update.py new file mode 100644 index 00000000000..3689d2c78c5 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pcdp/_update.py @@ -0,0 +1,277 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network pcdp update", +) +class Update(AAZCommand): + """Update packet core data planes tags. + + :example: Update Packet Core Data Plane + az mobile-network pcdp update -n pcdp_name -g rg --pccp-name pccp-name --tags "{tag:test,tag2:test2}" + """ + + _aaz_info = { + "version": "2022-11-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/packetcorecontrolplanes/{}/packetcoredataplanes/{}", "2022-11-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.pccp_name = AAZStrArg( + options=["--pccp-name"], + help="The name of the packet core control plane.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.pcdp_name = AAZStrArg( + options=["-n", "--name", "--pcdp-name"], + help="The name of the packet core data plane.", + required=True, + id_part="child_name_1", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + + # define Arg Group "Parameters" + + _args_schema = cls._args_schema + _args_schema.tags = AAZDictArg( + options=["--tags"], + arg_group="Parameters", + help="Resource tags.", + ) + + tags = cls._args_schema.tags + tags.Element = AAZStrArg() + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.PacketCoreDataPlanesUpdateTags(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class PacketCoreDataPlanesUpdateTags(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/{packetCoreControlPlaneName}/packetCoreDataPlanes/{packetCoreDataPlaneName}", + **self.url_parameters + ) + + @property + def method(self): + return "PATCH" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "packetCoreControlPlaneName", self.ctx.args.pccp_name, + required=True, + ), + **self.serialize_url_param( + "packetCoreDataPlaneName", self.ctx.args.pcdp_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + typ=AAZObjectType, + typ_kwargs={"flags": {"required": True, "client_flatten": True}} + ) + _builder.set_prop("tags", AAZDictType, ".tags") + + tags = _builder.get(".tags") + if tags is not None: + tags.set_elements(AAZStrType, ".") + + return self.serialize_content(_content_value) + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.location = AAZStrType( + flags={"required": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType( + flags={"required": True, "client_flatten": True}, + ) + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.user_plane_access_interface = AAZObjectType( + serialized_name="userPlaneAccessInterface", + flags={"required": True}, + ) + + user_plane_access_interface = cls._schema_on_200.properties.user_plane_access_interface + user_plane_access_interface.ipv4_address = AAZStrType( + serialized_name="ipv4Address", + ) + user_plane_access_interface.ipv4_gateway = AAZStrType( + serialized_name="ipv4Gateway", + ) + user_plane_access_interface.ipv4_subnet = AAZStrType( + serialized_name="ipv4Subnet", + ) + user_plane_access_interface.name = AAZStrType() + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _UpdateHelper: + """Helper class for Update""" + + +__all__ = ["Update"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pcdp/_wait.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pcdp/_wait.py new file mode 100644 index 00000000000..3f88060e6e2 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pcdp/_wait.py @@ -0,0 +1,243 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network pcdp wait", +) +class Wait(AAZWaitCommand): + """Place the CLI in a waiting state until a condition is met. + """ + + _aaz_info = { + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/packetcorecontrolplanes/{}/packetcoredataplanes/{}", "2022-11-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.pccp_name = AAZStrArg( + options=["--pccp-name"], + help="The name of the packet core control plane.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.pcdp_name = AAZStrArg( + options=["-n", "--name", "--pcdp-name"], + help="The name of the packet core data plane.", + required=True, + id_part="child_name_1", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.PacketCoreDataPlanesGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) + return result + + class PacketCoreDataPlanesGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/{packetCoreControlPlaneName}/packetCoreDataPlanes/{packetCoreDataPlaneName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "packetCoreControlPlaneName", self.ctx.args.pccp_name, + required=True, + ), + **self.serialize_url_param( + "packetCoreDataPlaneName", self.ctx.args.pcdp_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.location = AAZStrType( + flags={"required": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType( + flags={"required": True, "client_flatten": True}, + ) + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.user_plane_access_interface = AAZObjectType( + serialized_name="userPlaneAccessInterface", + flags={"required": True}, + ) + + user_plane_access_interface = cls._schema_on_200.properties.user_plane_access_interface + user_plane_access_interface.ipv4_address = AAZStrType( + serialized_name="ipv4Address", + ) + user_plane_access_interface.ipv4_gateway = AAZStrType( + serialized_name="ipv4Gateway", + ) + user_plane_access_interface.ipv4_subnet = AAZStrType( + serialized_name="ipv4Subnet", + ) + user_plane_access_interface.name = AAZStrType() + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _WaitHelper: + """Helper class for Wait""" + + +__all__ = ["Wait"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/service/__cmd_group.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/service/__cmd_group.py new file mode 100644 index 00000000000..9a5b8bd7ab2 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/service/__cmd_group.py @@ -0,0 +1,23 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command_group( + "mobile-network service", +) +class __CMDGroup(AAZCommandGroup): + """Manage service + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/service/__init__.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/service/__init__.py new file mode 100644 index 00000000000..db73033039b --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/service/__init__.py @@ -0,0 +1,17 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * +from ._create import * +from ._delete import * +from ._list import * +from ._show import * +from ._update import * +from ._wait import * diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/service/_create.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/service/_create.py new file mode 100644 index 00000000000..26512943bbd --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/service/_create.py @@ -0,0 +1,721 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network service create", +) +class Create(AAZCommand): + """Create a service. + + :example: Create service + az mobile-network service create -n service-name -g rg --mobile-network-name mobile-network-name --pcc-rules "[{ruleName:default-rule,rulePrecedence:10,serviceDataFlowTemplates:[{templateName:IP-to-server,direction:Uplink,protocol:[ip],remoteIpList:[10.3.4.0/24]}]}]" --service-precedence 10 + """ + + _aaz_info = { + "version": "2022-11-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/mobilenetworks/{}/services/{}", "2022-11-01"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.mobile_network_name = AAZStrArg( + options=["--mobile-network-name"], + help="The name of the mobile network.", + required=True, + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.service_name = AAZStrArg( + options=["-n", "--name", "--service-name"], + help="The name of the service. You must not use any of the following reserved strings - `default`, `requested` or `service`", + required=True, + fmt=AAZStrArgFormat( + pattern="^(?!(default|requested|service)$)[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + + # define Arg Group "Parameters" + + _args_schema = cls._args_schema + _args_schema.location = AAZResourceLocationArg( + arg_group="Parameters", + help="The geo-location where the resource lives", + required=True, + fmt=AAZResourceLocationArgFormat( + resource_group_arg="resource_group", + ), + ) + _args_schema.tags = AAZDictArg( + options=["--tags"], + arg_group="Parameters", + help="Resource tags.", + ) + + tags = cls._args_schema.tags + tags.Element = AAZStrArg() + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.pcc_rules = AAZListArg( + options=["--pcc-rules"], + arg_group="Properties", + help="The set of data flow policy rules that make up this service.", + required=True, + fmt=AAZListArgFormat( + unique=True, + ), + ) + _args_schema.service_precedence = AAZIntArg( + options=["--service-precedence"], + arg_group="Properties", + help="A precedence value that is used to decide between services when identifying the QoS values to use for a particular SIM. A lower value means a higher priority. This value should be unique among all services configured in the mobile network.", + required=True, + fmt=AAZIntArgFormat( + maximum=255, + minimum=0, + ), + ) + _args_schema.service_qos_policy = AAZObjectArg( + options=["--service-qos-policy"], + arg_group="Properties", + help="The QoS policy to use for packets matching this service. This can be overridden for particular flows using the ruleQosPolicy field in a PccRuleConfiguration. If this field is null then the UE's SIM policy will define the QoS settings.", + ) + + pcc_rules = cls._args_schema.pcc_rules + pcc_rules.Element = AAZObjectArg() + + _element = cls._args_schema.pcc_rules.Element + _element.rule_name = AAZStrArg( + options=["rule-name"], + help="The name of the rule. This must be unique within the parent service. You must not use any of the following reserved strings - `default`, `requested` or `service`.", + required=True, + fmt=AAZStrArgFormat( + pattern="^(?!(default|requested|service)$)[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _element.rule_precedence = AAZIntArg( + options=["rule-precedence"], + help="A precedence value that is used to decide between data flow policy rules when identifying the QoS values to use for a particular SIM. A lower value means a higher priority. This value should be unique among all data flow policy rules configured in the mobile network.", + required=True, + fmt=AAZIntArgFormat( + maximum=255, + minimum=0, + ), + ) + _element.rule_qos_policy = AAZObjectArg( + options=["rule-qos-policy"], + help="The QoS policy to use for packets matching this rule. If this field is null then the parent service will define the QoS settings.", + ) + _element.service_data_flow_templates = AAZListArg( + options=["service-data-flow-templates"], + help="The set of data flow templates to use for this data flow policy rule.", + required=True, + fmt=AAZListArgFormat( + unique=True, + ), + ) + _element.traffic_control = AAZStrArg( + options=["traffic-control"], + help="Determines whether flows that match this data flow policy rule are permitted.", + default="Enabled", + enum={"Blocked": "Blocked", "Enabled": "Enabled"}, + ) + + rule_qos_policy = cls._args_schema.pcc_rules.Element.rule_qos_policy + rule_qos_policy.five_qi = AAZIntArg( + options=["five-qi"], + help="QoS Flow 5G QoS Indicator value. The 5QI identifies a specific QoS forwarding treatment to be provided to a flow. This must not be a standardized 5QI value corresponding to a GBR (guaranteed bit rate) QoS Flow. The illegal GBR 5QI values are: 1, 2, 3, 4, 65, 66, 67, 71, 72, 73, 74, 75, 76, 82, 83, 84, and 85. See 3GPP TS23.501 section 5.7.2.1 for a full description of the 5QI parameter, and table 5.7.4-1 for the definition of which are the GBR 5QI values.", + default=9, + fmt=AAZIntArgFormat( + maximum=127, + minimum=1, + ), + ) + rule_qos_policy.allocation_and_retention_priority_level = AAZIntArg( + options=["allocation-and-retention-priority-level"], + help="QoS Flow allocation and retention priority (ARP) level. Flows with higher priority preempt flows with lower priority, if the settings of `preemptionCapability` and `preemptionVulnerability` allow it. 1 is the highest level of priority. If this field is not specified then `5qi` is used to derive the ARP value. See 3GPP TS23.501 section 5.7.2.2 for a full description of the ARP parameters.", + default=9, + fmt=AAZIntArgFormat( + maximum=15, + minimum=1, + ), + ) + rule_qos_policy.guaranteed_bit_rate = AAZObjectArg( + options=["guaranteed-bit-rate"], + help="The guaranteed bit rate (GBR) for all service data flows that use this data flow policy rule. This is an optional setting. If you do not provide a value, there will be no GBR set for the data flow policy rule that uses this QoS definition.", + ) + cls._build_args_ambr_create(rule_qos_policy.guaranteed_bit_rate) + rule_qos_policy.maximum_bit_rate = AAZObjectArg( + options=["maximum-bit-rate"], + help="The maximum bit rate (MBR) for all service data flows that use this data flow policy rule or service.", + required=True, + ) + cls._build_args_ambr_create(rule_qos_policy.maximum_bit_rate) + rule_qos_policy.preemption_capability = AAZStrArg( + options=["preemption-capability"], + help="QoS Flow preemption capability. The preemption capability of a QoS Flow controls whether it can preempt another QoS Flow with a lower priority level. See 3GPP TS23.501 section 5.7.2.2 for a full description of the ARP parameters.", + default="NotPreempt", + enum={"MayPreempt": "MayPreempt", "NotPreempt": "NotPreempt"}, + ) + rule_qos_policy.preemption_vulnerability = AAZStrArg( + options=["preemption-vulnerability"], + help="QoS Flow preemption vulnerability. The preemption vulnerability of a QoS Flow controls whether it can be preempted by a QoS Flow with a higher priority level. See 3GPP TS23.501 section 5.7.2.2 for a full description of the ARP parameters.", + default="Preemptable", + enum={"NotPreemptable": "NotPreemptable", "Preemptable": "Preemptable"}, + ) + + service_data_flow_templates = cls._args_schema.pcc_rules.Element.service_data_flow_templates + service_data_flow_templates.Element = AAZObjectArg() + + _element = cls._args_schema.pcc_rules.Element.service_data_flow_templates.Element + _element.direction = AAZStrArg( + options=["direction"], + help="The direction of this flow.", + required=True, + enum={"Bidirectional": "Bidirectional", "Downlink": "Downlink", "Uplink": "Uplink"}, + ) + _element.ports = AAZListArg( + options=["ports"], + help="The port(s) to which UEs will connect for this flow. You can specify zero or more ports or port ranges. If you specify one or more ports or port ranges then you must specify a value other than `ip` in the `protocol` field. This is an optional setting. If you do not specify it then connections will be allowed on all ports. Port ranges must be specified as -. For example: [`8080`, `8082-8085`].", + fmt=AAZListArgFormat( + unique=True, + ), + ) + _element.protocol = AAZListArg( + options=["protocol"], + help="A list of the allowed protocol(s) for this flow. If you want this flow to be able to use any protocol within the internet protocol suite, use the value `ip`. If you only want to allow a selection of protocols, you must use the corresponding IANA Assigned Internet Protocol Number for each protocol, as described in https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml. For example, for UDP, you must use 17. If you use the value `ip` then you must leave the field `port` unspecified.", + required=True, + fmt=AAZListArgFormat( + unique=True, + ), + ) + _element.remote_ip_list = AAZListArg( + options=["remote-ip-list"], + help="The remote IP address(es) to which UEs will connect for this flow. If you want to allow connections on any IP address, use the value `any`. Otherwise, you must provide each of the remote IP addresses to which the packet core instance will connect for this flow. You must provide each IP address in CIDR notation, including the netmask (for example, 192.0.2.54/24).", + required=True, + fmt=AAZListArgFormat( + unique=True, + ), + ) + _element.template_name = AAZStrArg( + options=["template-name"], + help="The name of the data flow template. This must be unique within the parent data flow policy rule. You must not use any of the following reserved strings - `default`, `requested` or `service`.", + required=True, + fmt=AAZStrArgFormat( + pattern="^(?!(default|requested|service)$)[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + + ports = cls._args_schema.pcc_rules.Element.service_data_flow_templates.Element.ports + ports.Element = AAZStrArg( + fmt=AAZStrArgFormat( + pattern="^([1-9]|[1-9][0-9]{1,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])(-([1-9]|[1-9][0-9]{1,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5]))?$", + ), + ) + + protocol = cls._args_schema.pcc_rules.Element.service_data_flow_templates.Element.protocol + protocol.Element = AAZStrArg( + fmt=AAZStrArgFormat( + pattern="^(ip|[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$", + ), + ) + + remote_ip_list = cls._args_schema.pcc_rules.Element.service_data_flow_templates.Element.remote_ip_list + remote_ip_list.Element = AAZStrArg( + fmt=AAZStrArgFormat( + pattern="^(any|(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2])))$", + ), + ) + + service_qos_policy = cls._args_schema.service_qos_policy + service_qos_policy.five_qi = AAZIntArg( + options=["five-qi"], + help="QoS Flow 5G QoS Indicator value. The 5QI identifies a specific QoS forwarding treatment to be provided to a flow. This must not be a standardized 5QI value corresponding to a GBR (guaranteed bit rate) QoS Flow. The illegal GBR 5QI values are: 1, 2, 3, 4, 65, 66, 67, 71, 72, 73, 74, 75, 76, 82, 83, 84, and 85. See 3GPP TS23.501 section 5.7.2.1 for a full description of the 5QI parameter, and table 5.7.4-1 for the definition of which are the GBR 5QI values.", + default=9, + fmt=AAZIntArgFormat( + maximum=127, + minimum=1, + ), + ) + service_qos_policy.allocation_and_retention_priority_level = AAZIntArg( + options=["allocation-and-retention-priority-level"], + help="QoS Flow allocation and retention priority (ARP) level. Flows with higher priority preempt flows with lower priority, if the settings of `preemptionCapability` and `preemptionVulnerability` allow it. 1 is the highest level of priority. If this field is not specified then `5qi` is used to derive the ARP value. See 3GPP TS23.501 section 5.7.2.2 for a full description of the ARP parameters.", + default=9, + fmt=AAZIntArgFormat( + maximum=15, + minimum=1, + ), + ) + service_qos_policy.maximum_bit_rate = AAZObjectArg( + options=["maximum-bit-rate"], + help="The maximum bit rate (MBR) for all service data flows that use this data flow policy rule or service.", + required=True, + ) + cls._build_args_ambr_create(service_qos_policy.maximum_bit_rate) + service_qos_policy.preemption_capability = AAZStrArg( + options=["preemption-capability"], + help="QoS Flow preemption capability. The preemption capability of a QoS Flow controls whether it can preempt another QoS Flow with a lower priority level. See 3GPP TS23.501 section 5.7.2.2 for a full description of the ARP parameters.", + default="NotPreempt", + enum={"MayPreempt": "MayPreempt", "NotPreempt": "NotPreempt"}, + ) + service_qos_policy.preemption_vulnerability = AAZStrArg( + options=["preemption-vulnerability"], + help="QoS Flow preemption vulnerability. The preemption vulnerability of a QoS Flow controls whether it can be preempted by a QoS Flow with a higher priority level. See 3GPP TS23.501 section 5.7.2.2 for a full description of the ARP parameters.", + default="Preemptable", + enum={"NotPreemptable": "NotPreemptable", "Preemptable": "Preemptable"}, + ) + return cls._args_schema + + _args_ambr_create = None + + @classmethod + def _build_args_ambr_create(cls, _schema): + if cls._args_ambr_create is not None: + _schema.downlink = cls._args_ambr_create.downlink + _schema.uplink = cls._args_ambr_create.uplink + return + + cls._args_ambr_create = AAZObjectArg() + + ambr_create = cls._args_ambr_create + ambr_create.downlink = AAZStrArg( + options=["downlink"], + help="Downlink bit rate.", + required=True, + fmt=AAZStrArgFormat( + pattern="^\d+(\.\d+)? (bps|Kbps|Mbps|Gbps|Tbps)$", + ), + ) + ambr_create.uplink = AAZStrArg( + options=["uplink"], + help="Uplink bit rate.", + required=True, + fmt=AAZStrArgFormat( + pattern="^\d+(\.\d+)? (bps|Kbps|Mbps|Gbps|Tbps)$", + ), + ) + + _schema.downlink = cls._args_ambr_create.downlink + _schema.uplink = cls._args_ambr_create.uplink + + def _execute_operations(self): + self.pre_operations() + yield self.ServicesCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class ServicesCreateOrUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200, 201]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/mobileNetworks/{mobileNetworkName}/services/{serviceName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "mobileNetworkName", self.ctx.args.mobile_network_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "serviceName", self.ctx.args.service_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + typ=AAZObjectType, + typ_kwargs={"flags": {"required": True, "client_flatten": True}} + ) + _builder.set_prop("location", AAZStrType, ".location", typ_kwargs={"flags": {"required": True}}) + _builder.set_prop("properties", AAZObjectType, ".", typ_kwargs={"flags": {"required": True, "client_flatten": True}}) + _builder.set_prop("tags", AAZDictType, ".tags") + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("pccRules", AAZListType, ".pcc_rules", typ_kwargs={"flags": {"required": True}}) + properties.set_prop("servicePrecedence", AAZIntType, ".service_precedence", typ_kwargs={"flags": {"required": True}}) + properties.set_prop("serviceQosPolicy", AAZObjectType, ".service_qos_policy") + + pcc_rules = _builder.get(".properties.pccRules") + if pcc_rules is not None: + pcc_rules.set_elements(AAZObjectType, ".") + + _elements = _builder.get(".properties.pccRules[]") + if _elements is not None: + _elements.set_prop("ruleName", AAZStrType, ".rule_name", typ_kwargs={"flags": {"required": True}}) + _elements.set_prop("rulePrecedence", AAZIntType, ".rule_precedence", typ_kwargs={"flags": {"required": True}}) + _elements.set_prop("ruleQosPolicy", AAZObjectType, ".rule_qos_policy") + _elements.set_prop("serviceDataFlowTemplates", AAZListType, ".service_data_flow_templates", typ_kwargs={"flags": {"required": True}}) + _elements.set_prop("trafficControl", AAZStrType, ".traffic_control") + + rule_qos_policy = _builder.get(".properties.pccRules[].ruleQosPolicy") + if rule_qos_policy is not None: + rule_qos_policy.set_prop("5qi", AAZIntType, ".five_qi") + rule_qos_policy.set_prop("allocationAndRetentionPriorityLevel", AAZIntType, ".allocation_and_retention_priority_level") + _CreateHelper._build_schema_ambr_create(rule_qos_policy.set_prop("guaranteedBitRate", AAZObjectType, ".guaranteed_bit_rate")) + _CreateHelper._build_schema_ambr_create(rule_qos_policy.set_prop("maximumBitRate", AAZObjectType, ".maximum_bit_rate", typ_kwargs={"flags": {"required": True}})) + rule_qos_policy.set_prop("preemptionCapability", AAZStrType, ".preemption_capability") + rule_qos_policy.set_prop("preemptionVulnerability", AAZStrType, ".preemption_vulnerability") + + service_data_flow_templates = _builder.get(".properties.pccRules[].serviceDataFlowTemplates") + if service_data_flow_templates is not None: + service_data_flow_templates.set_elements(AAZObjectType, ".") + + _elements = _builder.get(".properties.pccRules[].serviceDataFlowTemplates[]") + if _elements is not None: + _elements.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) + _elements.set_prop("ports", AAZListType, ".ports") + _elements.set_prop("protocol", AAZListType, ".protocol", typ_kwargs={"flags": {"required": True}}) + _elements.set_prop("remoteIpList", AAZListType, ".remote_ip_list", typ_kwargs={"flags": {"required": True}}) + _elements.set_prop("templateName", AAZStrType, ".template_name", typ_kwargs={"flags": {"required": True}}) + + ports = _builder.get(".properties.pccRules[].serviceDataFlowTemplates[].ports") + if ports is not None: + ports.set_elements(AAZStrType, ".") + + protocol = _builder.get(".properties.pccRules[].serviceDataFlowTemplates[].protocol") + if protocol is not None: + protocol.set_elements(AAZStrType, ".") + + remote_ip_list = _builder.get(".properties.pccRules[].serviceDataFlowTemplates[].remoteIpList") + if remote_ip_list is not None: + remote_ip_list.set_elements(AAZStrType, ".") + + service_qos_policy = _builder.get(".properties.serviceQosPolicy") + if service_qos_policy is not None: + service_qos_policy.set_prop("5qi", AAZIntType, ".five_qi") + service_qos_policy.set_prop("allocationAndRetentionPriorityLevel", AAZIntType, ".allocation_and_retention_priority_level") + _CreateHelper._build_schema_ambr_create(service_qos_policy.set_prop("maximumBitRate", AAZObjectType, ".maximum_bit_rate", typ_kwargs={"flags": {"required": True}})) + service_qos_policy.set_prop("preemptionCapability", AAZStrType, ".preemption_capability") + service_qos_policy.set_prop("preemptionVulnerability", AAZStrType, ".preemption_vulnerability") + + tags = _builder.get(".tags") + if tags is not None: + tags.set_elements(AAZStrType, ".") + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + + _schema_on_200_201 = cls._schema_on_200_201 + _schema_on_200_201.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.location = AAZStrType( + flags={"required": True}, + ) + _schema_on_200_201.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.properties = AAZObjectType( + flags={"required": True, "client_flatten": True}, + ) + _schema_on_200_201.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200_201.tags = AAZDictType() + _schema_on_200_201.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200_201.properties + properties.pcc_rules = AAZListType( + serialized_name="pccRules", + flags={"required": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.service_precedence = AAZIntType( + serialized_name="servicePrecedence", + flags={"required": True}, + ) + properties.service_qos_policy = AAZObjectType( + serialized_name="serviceQosPolicy", + ) + + pcc_rules = cls._schema_on_200_201.properties.pcc_rules + pcc_rules.Element = AAZObjectType() + + _element = cls._schema_on_200_201.properties.pcc_rules.Element + _element.rule_name = AAZStrType( + serialized_name="ruleName", + flags={"required": True}, + ) + _element.rule_precedence = AAZIntType( + serialized_name="rulePrecedence", + flags={"required": True}, + ) + _element.rule_qos_policy = AAZObjectType( + serialized_name="ruleQosPolicy", + ) + _element.service_data_flow_templates = AAZListType( + serialized_name="serviceDataFlowTemplates", + flags={"required": True}, + ) + _element.traffic_control = AAZStrType( + serialized_name="trafficControl", + ) + + rule_qos_policy = cls._schema_on_200_201.properties.pcc_rules.Element.rule_qos_policy + rule_qos_policy["5qi"] = AAZIntType() + rule_qos_policy.allocation_and_retention_priority_level = AAZIntType( + serialized_name="allocationAndRetentionPriorityLevel", + ) + rule_qos_policy.guaranteed_bit_rate = AAZObjectType( + serialized_name="guaranteedBitRate", + ) + _CreateHelper._build_schema_ambr_read(rule_qos_policy.guaranteed_bit_rate) + rule_qos_policy.maximum_bit_rate = AAZObjectType( + serialized_name="maximumBitRate", + flags={"required": True}, + ) + _CreateHelper._build_schema_ambr_read(rule_qos_policy.maximum_bit_rate) + rule_qos_policy.preemption_capability = AAZStrType( + serialized_name="preemptionCapability", + ) + rule_qos_policy.preemption_vulnerability = AAZStrType( + serialized_name="preemptionVulnerability", + ) + + service_data_flow_templates = cls._schema_on_200_201.properties.pcc_rules.Element.service_data_flow_templates + service_data_flow_templates.Element = AAZObjectType() + + _element = cls._schema_on_200_201.properties.pcc_rules.Element.service_data_flow_templates.Element + _element.direction = AAZStrType( + flags={"required": True}, + ) + _element.ports = AAZListType() + _element.protocol = AAZListType( + flags={"required": True}, + ) + _element.remote_ip_list = AAZListType( + serialized_name="remoteIpList", + flags={"required": True}, + ) + _element.template_name = AAZStrType( + serialized_name="templateName", + flags={"required": True}, + ) + + ports = cls._schema_on_200_201.properties.pcc_rules.Element.service_data_flow_templates.Element.ports + ports.Element = AAZStrType() + + protocol = cls._schema_on_200_201.properties.pcc_rules.Element.service_data_flow_templates.Element.protocol + protocol.Element = AAZStrType() + + remote_ip_list = cls._schema_on_200_201.properties.pcc_rules.Element.service_data_flow_templates.Element.remote_ip_list + remote_ip_list.Element = AAZStrType() + + service_qos_policy = cls._schema_on_200_201.properties.service_qos_policy + service_qos_policy["5qi"] = AAZIntType() + service_qos_policy.allocation_and_retention_priority_level = AAZIntType( + serialized_name="allocationAndRetentionPriorityLevel", + ) + service_qos_policy.maximum_bit_rate = AAZObjectType( + serialized_name="maximumBitRate", + flags={"required": True}, + ) + _CreateHelper._build_schema_ambr_read(service_qos_policy.maximum_bit_rate) + service_qos_policy.preemption_capability = AAZStrType( + serialized_name="preemptionCapability", + ) + service_qos_policy.preemption_vulnerability = AAZStrType( + serialized_name="preemptionVulnerability", + ) + + system_data = cls._schema_on_200_201.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200_201.tags + tags.Element = AAZStrType() + + return cls._schema_on_200_201 + + +class _CreateHelper: + """Helper class for Create""" + + @classmethod + def _build_schema_ambr_create(cls, _builder): + if _builder is None: + return + _builder.set_prop("downlink", AAZStrType, ".downlink", typ_kwargs={"flags": {"required": True}}) + _builder.set_prop("uplink", AAZStrType, ".uplink", typ_kwargs={"flags": {"required": True}}) + + _schema_ambr_read = None + + @classmethod + def _build_schema_ambr_read(cls, _schema): + if cls._schema_ambr_read is not None: + _schema.downlink = cls._schema_ambr_read.downlink + _schema.uplink = cls._schema_ambr_read.uplink + return + + cls._schema_ambr_read = _schema_ambr_read = AAZObjectType() + + ambr_read = _schema_ambr_read + ambr_read.downlink = AAZStrType( + flags={"required": True}, + ) + ambr_read.uplink = AAZStrType( + flags={"required": True}, + ) + + _schema.downlink = cls._schema_ambr_read.downlink + _schema.uplink = cls._schema_ambr_read.uplink + + +__all__ = ["Create"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/service/_delete.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/service/_delete.py new file mode 100644 index 00000000000..f3ea297b9b5 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/service/_delete.py @@ -0,0 +1,181 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network service delete", + confirmation="Are you sure you want to perform this operation?", +) +class Delete(AAZCommand): + """Delete the specified service. + + :example: Delete service + az mobile-network service delete --mobile-network-name mobile-network-name -n service -g rg -y + """ + + _aaz_info = { + "version": "2022-11-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/mobilenetworks/{}/services/{}", "2022-11-01"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, None) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.mobile_network_name = AAZStrArg( + options=["--mobile-network-name"], + help="The name of the mobile network.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.service_name = AAZStrArg( + options=["-n", "--name", "--service-name"], + help="The name of the service. You must not use any of the following reserved strings - `default`, `requested` or `service`", + required=True, + id_part="child_name_1", + fmt=AAZStrArgFormat( + pattern="^(?!(default|requested|service)$)[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + yield self.ServicesDelete(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + class ServicesDelete(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [204]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_204, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/mobileNetworks/{mobileNetworkName}/services/{serviceName}", + **self.url_parameters + ) + + @property + def method(self): + return "DELETE" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "mobileNetworkName", self.ctx.args.mobile_network_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "serviceName", self.ctx.args.service_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + def on_200(self, session): + pass + + def on_204(self, session): + pass + + +class _DeleteHelper: + """Helper class for Delete""" + + +__all__ = ["Delete"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/service/_list.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/service/_list.py new file mode 100644 index 00000000000..e422845b3be --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/service/_list.py @@ -0,0 +1,349 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network service list", +) +class List(AAZCommand): + """List all the services in a mobile network. + + :example: List service by resource group + az mobile-network service list --mobile-network-name mobile-network-name -g rg + """ + + _aaz_info = { + "version": "2022-11-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/mobilenetworks/{}/services", "2022-11-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_paging(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.mobile_network_name = AAZStrArg( + options=["--mobile-network-name"], + help="The name of the mobile network.", + required=True, + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.ServicesListByMobileNetwork(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) + next_link = self.deserialize_output(self.ctx.vars.instance.next_link) + return result, next_link + + class ServicesListByMobileNetwork(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/mobileNetworks/{mobileNetworkName}/services", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "mobileNetworkName", self.ctx.args.mobile_network_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.next_link = AAZStrType( + serialized_name="nextLink", + flags={"read_only": True}, + ) + _schema_on_200.value = AAZListType() + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.location = AAZStrType( + flags={"required": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType( + flags={"required": True, "client_flatten": True}, + ) + _element.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _element.tags = AAZDictType() + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.pcc_rules = AAZListType( + serialized_name="pccRules", + flags={"required": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.service_precedence = AAZIntType( + serialized_name="servicePrecedence", + flags={"required": True}, + ) + properties.service_qos_policy = AAZObjectType( + serialized_name="serviceQosPolicy", + ) + + pcc_rules = cls._schema_on_200.value.Element.properties.pcc_rules + pcc_rules.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element.properties.pcc_rules.Element + _element.rule_name = AAZStrType( + serialized_name="ruleName", + flags={"required": True}, + ) + _element.rule_precedence = AAZIntType( + serialized_name="rulePrecedence", + flags={"required": True}, + ) + _element.rule_qos_policy = AAZObjectType( + serialized_name="ruleQosPolicy", + ) + _element.service_data_flow_templates = AAZListType( + serialized_name="serviceDataFlowTemplates", + flags={"required": True}, + ) + _element.traffic_control = AAZStrType( + serialized_name="trafficControl", + ) + + rule_qos_policy = cls._schema_on_200.value.Element.properties.pcc_rules.Element.rule_qos_policy + rule_qos_policy["5qi"] = AAZIntType() + rule_qos_policy.allocation_and_retention_priority_level = AAZIntType( + serialized_name="allocationAndRetentionPriorityLevel", + ) + rule_qos_policy.guaranteed_bit_rate = AAZObjectType( + serialized_name="guaranteedBitRate", + ) + _ListHelper._build_schema_ambr_read(rule_qos_policy.guaranteed_bit_rate) + rule_qos_policy.maximum_bit_rate = AAZObjectType( + serialized_name="maximumBitRate", + flags={"required": True}, + ) + _ListHelper._build_schema_ambr_read(rule_qos_policy.maximum_bit_rate) + rule_qos_policy.preemption_capability = AAZStrType( + serialized_name="preemptionCapability", + ) + rule_qos_policy.preemption_vulnerability = AAZStrType( + serialized_name="preemptionVulnerability", + ) + + service_data_flow_templates = cls._schema_on_200.value.Element.properties.pcc_rules.Element.service_data_flow_templates + service_data_flow_templates.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element.properties.pcc_rules.Element.service_data_flow_templates.Element + _element.direction = AAZStrType( + flags={"required": True}, + ) + _element.ports = AAZListType() + _element.protocol = AAZListType( + flags={"required": True}, + ) + _element.remote_ip_list = AAZListType( + serialized_name="remoteIpList", + flags={"required": True}, + ) + _element.template_name = AAZStrType( + serialized_name="templateName", + flags={"required": True}, + ) + + ports = cls._schema_on_200.value.Element.properties.pcc_rules.Element.service_data_flow_templates.Element.ports + ports.Element = AAZStrType() + + protocol = cls._schema_on_200.value.Element.properties.pcc_rules.Element.service_data_flow_templates.Element.protocol + protocol.Element = AAZStrType() + + remote_ip_list = cls._schema_on_200.value.Element.properties.pcc_rules.Element.service_data_flow_templates.Element.remote_ip_list + remote_ip_list.Element = AAZStrType() + + service_qos_policy = cls._schema_on_200.value.Element.properties.service_qos_policy + service_qos_policy["5qi"] = AAZIntType() + service_qos_policy.allocation_and_retention_priority_level = AAZIntType( + serialized_name="allocationAndRetentionPriorityLevel", + ) + service_qos_policy.maximum_bit_rate = AAZObjectType( + serialized_name="maximumBitRate", + flags={"required": True}, + ) + _ListHelper._build_schema_ambr_read(service_qos_policy.maximum_bit_rate) + service_qos_policy.preemption_capability = AAZStrType( + serialized_name="preemptionCapability", + ) + service_qos_policy.preemption_vulnerability = AAZStrType( + serialized_name="preemptionVulnerability", + ) + + system_data = cls._schema_on_200.value.Element.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.value.Element.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _ListHelper: + """Helper class for List""" + + _schema_ambr_read = None + + @classmethod + def _build_schema_ambr_read(cls, _schema): + if cls._schema_ambr_read is not None: + _schema.downlink = cls._schema_ambr_read.downlink + _schema.uplink = cls._schema_ambr_read.uplink + return + + cls._schema_ambr_read = _schema_ambr_read = AAZObjectType() + + ambr_read = _schema_ambr_read + ambr_read.downlink = AAZStrType( + flags={"required": True}, + ) + ambr_read.uplink = AAZStrType( + flags={"required": True}, + ) + + _schema.downlink = cls._schema_ambr_read.downlink + _schema.uplink = cls._schema_ambr_read.uplink + + +__all__ = ["List"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/service/_show.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/service/_show.py new file mode 100644 index 00000000000..6d2d62f27f0 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/service/_show.py @@ -0,0 +1,354 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network service show", +) +class Show(AAZCommand): + """Get information about the specified service. + + :example: Show service + az mobile-network service show --mobile-network-name mobile-network-name -n service -g rg + """ + + _aaz_info = { + "version": "2022-11-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/mobilenetworks/{}/services/{}", "2022-11-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.mobile_network_name = AAZStrArg( + options=["--mobile-network-name"], + help="The name of the mobile network.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.service_name = AAZStrArg( + options=["-n", "--name", "--service-name"], + help="The name of the service. You must not use any of the following reserved strings - `default`, `requested` or `service`", + required=True, + id_part="child_name_1", + fmt=AAZStrArgFormat( + pattern="^(?!(default|requested|service)$)[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.ServicesGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class ServicesGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/mobileNetworks/{mobileNetworkName}/services/{serviceName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "mobileNetworkName", self.ctx.args.mobile_network_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "serviceName", self.ctx.args.service_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.location = AAZStrType( + flags={"required": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType( + flags={"required": True, "client_flatten": True}, + ) + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.pcc_rules = AAZListType( + serialized_name="pccRules", + flags={"required": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.service_precedence = AAZIntType( + serialized_name="servicePrecedence", + flags={"required": True}, + ) + properties.service_qos_policy = AAZObjectType( + serialized_name="serviceQosPolicy", + ) + + pcc_rules = cls._schema_on_200.properties.pcc_rules + pcc_rules.Element = AAZObjectType() + + _element = cls._schema_on_200.properties.pcc_rules.Element + _element.rule_name = AAZStrType( + serialized_name="ruleName", + flags={"required": True}, + ) + _element.rule_precedence = AAZIntType( + serialized_name="rulePrecedence", + flags={"required": True}, + ) + _element.rule_qos_policy = AAZObjectType( + serialized_name="ruleQosPolicy", + ) + _element.service_data_flow_templates = AAZListType( + serialized_name="serviceDataFlowTemplates", + flags={"required": True}, + ) + _element.traffic_control = AAZStrType( + serialized_name="trafficControl", + ) + + rule_qos_policy = cls._schema_on_200.properties.pcc_rules.Element.rule_qos_policy + rule_qos_policy["5qi"] = AAZIntType() + rule_qos_policy.allocation_and_retention_priority_level = AAZIntType( + serialized_name="allocationAndRetentionPriorityLevel", + ) + rule_qos_policy.guaranteed_bit_rate = AAZObjectType( + serialized_name="guaranteedBitRate", + ) + _ShowHelper._build_schema_ambr_read(rule_qos_policy.guaranteed_bit_rate) + rule_qos_policy.maximum_bit_rate = AAZObjectType( + serialized_name="maximumBitRate", + flags={"required": True}, + ) + _ShowHelper._build_schema_ambr_read(rule_qos_policy.maximum_bit_rate) + rule_qos_policy.preemption_capability = AAZStrType( + serialized_name="preemptionCapability", + ) + rule_qos_policy.preemption_vulnerability = AAZStrType( + serialized_name="preemptionVulnerability", + ) + + service_data_flow_templates = cls._schema_on_200.properties.pcc_rules.Element.service_data_flow_templates + service_data_flow_templates.Element = AAZObjectType() + + _element = cls._schema_on_200.properties.pcc_rules.Element.service_data_flow_templates.Element + _element.direction = AAZStrType( + flags={"required": True}, + ) + _element.ports = AAZListType() + _element.protocol = AAZListType( + flags={"required": True}, + ) + _element.remote_ip_list = AAZListType( + serialized_name="remoteIpList", + flags={"required": True}, + ) + _element.template_name = AAZStrType( + serialized_name="templateName", + flags={"required": True}, + ) + + ports = cls._schema_on_200.properties.pcc_rules.Element.service_data_flow_templates.Element.ports + ports.Element = AAZStrType() + + protocol = cls._schema_on_200.properties.pcc_rules.Element.service_data_flow_templates.Element.protocol + protocol.Element = AAZStrType() + + remote_ip_list = cls._schema_on_200.properties.pcc_rules.Element.service_data_flow_templates.Element.remote_ip_list + remote_ip_list.Element = AAZStrType() + + service_qos_policy = cls._schema_on_200.properties.service_qos_policy + service_qos_policy["5qi"] = AAZIntType() + service_qos_policy.allocation_and_retention_priority_level = AAZIntType( + serialized_name="allocationAndRetentionPriorityLevel", + ) + service_qos_policy.maximum_bit_rate = AAZObjectType( + serialized_name="maximumBitRate", + flags={"required": True}, + ) + _ShowHelper._build_schema_ambr_read(service_qos_policy.maximum_bit_rate) + service_qos_policy.preemption_capability = AAZStrType( + serialized_name="preemptionCapability", + ) + service_qos_policy.preemption_vulnerability = AAZStrType( + serialized_name="preemptionVulnerability", + ) + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _ShowHelper: + """Helper class for Show""" + + _schema_ambr_read = None + + @classmethod + def _build_schema_ambr_read(cls, _schema): + if cls._schema_ambr_read is not None: + _schema.downlink = cls._schema_ambr_read.downlink + _schema.uplink = cls._schema_ambr_read.uplink + return + + cls._schema_ambr_read = _schema_ambr_read = AAZObjectType() + + ambr_read = _schema_ambr_read + ambr_read.downlink = AAZStrType( + flags={"required": True}, + ) + ambr_read.uplink = AAZStrType( + flags={"required": True}, + ) + + _schema.downlink = cls._schema_ambr_read.downlink + _schema.uplink = cls._schema_ambr_read.uplink + + +__all__ = ["Show"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/service/_update.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/service/_update.py new file mode 100644 index 00000000000..694e94aba0a --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/service/_update.py @@ -0,0 +1,862 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network service update", +) +class Update(AAZCommand): + """Update a service. + + :example: Update service tags + az mobile-network service update --mobile-network-name mobile-network-name -g rg -n service-name --tags "{tag:test,tag2:test2}" + """ + + _aaz_info = { + "version": "2022-11-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/mobilenetworks/{}/services/{}", "2022-11-01"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + AZ_SUPPORT_GENERIC_UPDATE = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.mobile_network_name = AAZStrArg( + options=["--mobile-network-name"], + help="The name of the mobile network.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.service_name = AAZStrArg( + options=["-n", "--name", "--service-name"], + help="The name of the service. You must not use any of the following reserved strings - `default`, `requested` or `service`", + required=True, + id_part="child_name_1", + fmt=AAZStrArgFormat( + pattern="^(?!(default|requested|service)$)[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + + # define Arg Group "Parameters" + + _args_schema = cls._args_schema + _args_schema.tags = AAZDictArg( + options=["--tags"], + arg_group="Parameters", + help="Resource tags.", + nullable=True, + ) + + tags = cls._args_schema.tags + tags.Element = AAZStrArg( + nullable=True, + ) + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.pcc_rules = AAZListArg( + options=["--pcc-rules"], + arg_group="Properties", + help="The set of data flow policy rules that make up this service.", + fmt=AAZListArgFormat( + unique=True, + ), + ) + _args_schema.service_precedence = AAZIntArg( + options=["--service-precedence"], + arg_group="Properties", + help="A precedence value that is used to decide between services when identifying the QoS values to use for a particular SIM. A lower value means a higher priority. This value should be unique among all services configured in the mobile network.", + fmt=AAZIntArgFormat( + maximum=255, + minimum=0, + ), + ) + _args_schema.service_qos_policy = AAZObjectArg( + options=["--service-qos-policy"], + arg_group="Properties", + help="The QoS policy to use for packets matching this service. This can be overridden for particular flows using the ruleQosPolicy field in a PccRuleConfiguration. If this field is null then the UE's SIM policy will define the QoS settings.", + nullable=True, + ) + + pcc_rules = cls._args_schema.pcc_rules + pcc_rules.Element = AAZObjectArg( + nullable=True, + ) + + _element = cls._args_schema.pcc_rules.Element + _element.rule_name = AAZStrArg( + options=["rule-name"], + help="The name of the rule. This must be unique within the parent service. You must not use any of the following reserved strings - `default`, `requested` or `service`.", + fmt=AAZStrArgFormat( + pattern="^(?!(default|requested|service)$)[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _element.rule_precedence = AAZIntArg( + options=["rule-precedence"], + help="A precedence value that is used to decide between data flow policy rules when identifying the QoS values to use for a particular SIM. A lower value means a higher priority. This value should be unique among all data flow policy rules configured in the mobile network.", + fmt=AAZIntArgFormat( + maximum=255, + minimum=0, + ), + ) + _element.rule_qos_policy = AAZObjectArg( + options=["rule-qos-policy"], + help="The QoS policy to use for packets matching this rule. If this field is null then the parent service will define the QoS settings.", + nullable=True, + ) + _element.service_data_flow_templates = AAZListArg( + options=["service-data-flow-templates"], + help="The set of data flow templates to use for this data flow policy rule.", + fmt=AAZListArgFormat( + unique=True, + ), + ) + _element.traffic_control = AAZStrArg( + options=["traffic-control"], + help="Determines whether flows that match this data flow policy rule are permitted.", + nullable=True, + enum={"Blocked": "Blocked", "Enabled": "Enabled"}, + ) + + rule_qos_policy = cls._args_schema.pcc_rules.Element.rule_qos_policy + rule_qos_policy.five_qi = AAZIntArg( + options=["five-qi"], + help="QoS Flow 5G QoS Indicator value. The 5QI identifies a specific QoS forwarding treatment to be provided to a flow. This must not be a standardized 5QI value corresponding to a GBR (guaranteed bit rate) QoS Flow. The illegal GBR 5QI values are: 1, 2, 3, 4, 65, 66, 67, 71, 72, 73, 74, 75, 76, 82, 83, 84, and 85. See 3GPP TS23.501 section 5.7.2.1 for a full description of the 5QI parameter, and table 5.7.4-1 for the definition of which are the GBR 5QI values.", + nullable=True, + fmt=AAZIntArgFormat( + maximum=127, + minimum=1, + ), + ) + rule_qos_policy.allocation_and_retention_priority_level = AAZIntArg( + options=["allocation-and-retention-priority-level"], + help="QoS Flow allocation and retention priority (ARP) level. Flows with higher priority preempt flows with lower priority, if the settings of `preemptionCapability` and `preemptionVulnerability` allow it. 1 is the highest level of priority. If this field is not specified then `5qi` is used to derive the ARP value. See 3GPP TS23.501 section 5.7.2.2 for a full description of the ARP parameters.", + nullable=True, + fmt=AAZIntArgFormat( + maximum=15, + minimum=1, + ), + ) + rule_qos_policy.guaranteed_bit_rate = AAZObjectArg( + options=["guaranteed-bit-rate"], + help="The guaranteed bit rate (GBR) for all service data flows that use this data flow policy rule. This is an optional setting. If you do not provide a value, there will be no GBR set for the data flow policy rule that uses this QoS definition.", + ) + cls._build_args_ambr_update(rule_qos_policy.guaranteed_bit_rate) + rule_qos_policy.maximum_bit_rate = AAZObjectArg( + options=["maximum-bit-rate"], + help="The maximum bit rate (MBR) for all service data flows that use this data flow policy rule or service.", + ) + cls._build_args_ambr_update(rule_qos_policy.maximum_bit_rate) + rule_qos_policy.preemption_capability = AAZStrArg( + options=["preemption-capability"], + help="QoS Flow preemption capability. The preemption capability of a QoS Flow controls whether it can preempt another QoS Flow with a lower priority level. See 3GPP TS23.501 section 5.7.2.2 for a full description of the ARP parameters.", + nullable=True, + enum={"MayPreempt": "MayPreempt", "NotPreempt": "NotPreempt"}, + ) + rule_qos_policy.preemption_vulnerability = AAZStrArg( + options=["preemption-vulnerability"], + help="QoS Flow preemption vulnerability. The preemption vulnerability of a QoS Flow controls whether it can be preempted by a QoS Flow with a higher priority level. See 3GPP TS23.501 section 5.7.2.2 for a full description of the ARP parameters.", + nullable=True, + enum={"NotPreemptable": "NotPreemptable", "Preemptable": "Preemptable"}, + ) + + service_data_flow_templates = cls._args_schema.pcc_rules.Element.service_data_flow_templates + service_data_flow_templates.Element = AAZObjectArg( + nullable=True, + ) + + _element = cls._args_schema.pcc_rules.Element.service_data_flow_templates.Element + _element.direction = AAZStrArg( + options=["direction"], + help="The direction of this flow.", + enum={"Bidirectional": "Bidirectional", "Downlink": "Downlink", "Uplink": "Uplink"}, + ) + _element.ports = AAZListArg( + options=["ports"], + help="The port(s) to which UEs will connect for this flow. You can specify zero or more ports or port ranges. If you specify one or more ports or port ranges then you must specify a value other than `ip` in the `protocol` field. This is an optional setting. If you do not specify it then connections will be allowed on all ports. Port ranges must be specified as -. For example: [`8080`, `8082-8085`].", + nullable=True, + fmt=AAZListArgFormat( + unique=True, + ), + ) + _element.protocol = AAZListArg( + options=["protocol"], + help="A list of the allowed protocol(s) for this flow. If you want this flow to be able to use any protocol within the internet protocol suite, use the value `ip`. If you only want to allow a selection of protocols, you must use the corresponding IANA Assigned Internet Protocol Number for each protocol, as described in https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml. For example, for UDP, you must use 17. If you use the value `ip` then you must leave the field `port` unspecified.", + fmt=AAZListArgFormat( + unique=True, + ), + ) + _element.remote_ip_list = AAZListArg( + options=["remote-ip-list"], + help="The remote IP address(es) to which UEs will connect for this flow. If you want to allow connections on any IP address, use the value `any`. Otherwise, you must provide each of the remote IP addresses to which the packet core instance will connect for this flow. You must provide each IP address in CIDR notation, including the netmask (for example, 192.0.2.54/24).", + fmt=AAZListArgFormat( + unique=True, + ), + ) + _element.template_name = AAZStrArg( + options=["template-name"], + help="The name of the data flow template. This must be unique within the parent data flow policy rule. You must not use any of the following reserved strings - `default`, `requested` or `service`.", + fmt=AAZStrArgFormat( + pattern="^(?!(default|requested|service)$)[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + + ports = cls._args_schema.pcc_rules.Element.service_data_flow_templates.Element.ports + ports.Element = AAZStrArg( + nullable=True, + fmt=AAZStrArgFormat( + pattern="^([1-9]|[1-9][0-9]{1,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])(-([1-9]|[1-9][0-9]{1,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5]))?$", + ), + ) + + protocol = cls._args_schema.pcc_rules.Element.service_data_flow_templates.Element.protocol + protocol.Element = AAZStrArg( + nullable=True, + fmt=AAZStrArgFormat( + pattern="^(ip|[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$", + ), + ) + + remote_ip_list = cls._args_schema.pcc_rules.Element.service_data_flow_templates.Element.remote_ip_list + remote_ip_list.Element = AAZStrArg( + nullable=True, + fmt=AAZStrArgFormat( + pattern="^(any|(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2])))$", + ), + ) + + service_qos_policy = cls._args_schema.service_qos_policy + service_qos_policy.five_qi = AAZIntArg( + options=["five-qi"], + help="QoS Flow 5G QoS Indicator value. The 5QI identifies a specific QoS forwarding treatment to be provided to a flow. This must not be a standardized 5QI value corresponding to a GBR (guaranteed bit rate) QoS Flow. The illegal GBR 5QI values are: 1, 2, 3, 4, 65, 66, 67, 71, 72, 73, 74, 75, 76, 82, 83, 84, and 85. See 3GPP TS23.501 section 5.7.2.1 for a full description of the 5QI parameter, and table 5.7.4-1 for the definition of which are the GBR 5QI values.", + nullable=True, + fmt=AAZIntArgFormat( + maximum=127, + minimum=1, + ), + ) + service_qos_policy.allocation_and_retention_priority_level = AAZIntArg( + options=["allocation-and-retention-priority-level"], + help="QoS Flow allocation and retention priority (ARP) level. Flows with higher priority preempt flows with lower priority, if the settings of `preemptionCapability` and `preemptionVulnerability` allow it. 1 is the highest level of priority. If this field is not specified then `5qi` is used to derive the ARP value. See 3GPP TS23.501 section 5.7.2.2 for a full description of the ARP parameters.", + nullable=True, + fmt=AAZIntArgFormat( + maximum=15, + minimum=1, + ), + ) + service_qos_policy.maximum_bit_rate = AAZObjectArg( + options=["maximum-bit-rate"], + help="The maximum bit rate (MBR) for all service data flows that use this data flow policy rule or service.", + ) + cls._build_args_ambr_update(service_qos_policy.maximum_bit_rate) + service_qos_policy.preemption_capability = AAZStrArg( + options=["preemption-capability"], + help="QoS Flow preemption capability. The preemption capability of a QoS Flow controls whether it can preempt another QoS Flow with a lower priority level. See 3GPP TS23.501 section 5.7.2.2 for a full description of the ARP parameters.", + nullable=True, + enum={"MayPreempt": "MayPreempt", "NotPreempt": "NotPreempt"}, + ) + service_qos_policy.preemption_vulnerability = AAZStrArg( + options=["preemption-vulnerability"], + help="QoS Flow preemption vulnerability. The preemption vulnerability of a QoS Flow controls whether it can be preempted by a QoS Flow with a higher priority level. See 3GPP TS23.501 section 5.7.2.2 for a full description of the ARP parameters.", + nullable=True, + enum={"NotPreemptable": "NotPreemptable", "Preemptable": "Preemptable"}, + ) + return cls._args_schema + + _args_ambr_update = None + + @classmethod + def _build_args_ambr_update(cls, _schema): + if cls._args_ambr_update is not None: + _schema.downlink = cls._args_ambr_update.downlink + _schema.uplink = cls._args_ambr_update.uplink + return + + cls._args_ambr_update = AAZObjectArg() + + ambr_update = cls._args_ambr_update + ambr_update.downlink = AAZStrArg( + options=["downlink"], + help="Downlink bit rate.", + fmt=AAZStrArgFormat( + pattern="^\d+(\.\d+)? (bps|Kbps|Mbps|Gbps|Tbps)$", + ), + ) + ambr_update.uplink = AAZStrArg( + options=["uplink"], + help="Uplink bit rate.", + fmt=AAZStrArgFormat( + pattern="^\d+(\.\d+)? (bps|Kbps|Mbps|Gbps|Tbps)$", + ), + ) + + _schema.downlink = cls._args_ambr_update.downlink + _schema.uplink = cls._args_ambr_update.uplink + + def _execute_operations(self): + self.pre_operations() + self.ServicesGet(ctx=self.ctx)() + self.pre_instance_update(self.ctx.vars.instance) + self.InstanceUpdateByJson(ctx=self.ctx)() + self.InstanceUpdateByGeneric(ctx=self.ctx)() + self.post_instance_update(self.ctx.vars.instance) + yield self.ServicesCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + @register_callback + def pre_instance_update(self, instance): + pass + + @register_callback + def post_instance_update(self, instance): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class ServicesGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/mobileNetworks/{mobileNetworkName}/services/{serviceName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "mobileNetworkName", self.ctx.args.mobile_network_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "serviceName", self.ctx.args.service_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + _UpdateHelper._build_schema_service_read(cls._schema_on_200) + + return cls._schema_on_200 + + class ServicesCreateOrUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200, 201]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/mobileNetworks/{mobileNetworkName}/services/{serviceName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "mobileNetworkName", self.ctx.args.mobile_network_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "serviceName", self.ctx.args.service_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + value=self.ctx.vars.instance, + ) + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + _UpdateHelper._build_schema_service_read(cls._schema_on_200_201) + + return cls._schema_on_200_201 + + class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): + + def __call__(self, *args, **kwargs): + self._update_instance(self.ctx.vars.instance) + + def _update_instance(self, instance): + _instance_value, _builder = self.new_content_builder( + self.ctx.args, + value=instance, + typ=AAZObjectType + ) + _builder.set_prop("properties", AAZObjectType, ".", typ_kwargs={"flags": {"required": True, "client_flatten": True}}) + _builder.set_prop("tags", AAZDictType, ".tags") + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("pccRules", AAZListType, ".pcc_rules", typ_kwargs={"flags": {"required": True}}) + properties.set_prop("servicePrecedence", AAZIntType, ".service_precedence", typ_kwargs={"flags": {"required": True}}) + properties.set_prop("serviceQosPolicy", AAZObjectType, ".service_qos_policy") + + pcc_rules = _builder.get(".properties.pccRules") + if pcc_rules is not None: + pcc_rules.set_elements(AAZObjectType, ".") + + _elements = _builder.get(".properties.pccRules[]") + if _elements is not None: + _elements.set_prop("ruleName", AAZStrType, ".rule_name", typ_kwargs={"flags": {"required": True}}) + _elements.set_prop("rulePrecedence", AAZIntType, ".rule_precedence", typ_kwargs={"flags": {"required": True}}) + _elements.set_prop("ruleQosPolicy", AAZObjectType, ".rule_qos_policy") + _elements.set_prop("serviceDataFlowTemplates", AAZListType, ".service_data_flow_templates", typ_kwargs={"flags": {"required": True}}) + _elements.set_prop("trafficControl", AAZStrType, ".traffic_control") + + rule_qos_policy = _builder.get(".properties.pccRules[].ruleQosPolicy") + if rule_qos_policy is not None: + rule_qos_policy.set_prop("5qi", AAZIntType, ".five_qi") + rule_qos_policy.set_prop("allocationAndRetentionPriorityLevel", AAZIntType, ".allocation_and_retention_priority_level") + _UpdateHelper._build_schema_ambr_update(rule_qos_policy.set_prop("guaranteedBitRate", AAZObjectType, ".guaranteed_bit_rate")) + _UpdateHelper._build_schema_ambr_update(rule_qos_policy.set_prop("maximumBitRate", AAZObjectType, ".maximum_bit_rate", typ_kwargs={"flags": {"required": True}})) + rule_qos_policy.set_prop("preemptionCapability", AAZStrType, ".preemption_capability") + rule_qos_policy.set_prop("preemptionVulnerability", AAZStrType, ".preemption_vulnerability") + + service_data_flow_templates = _builder.get(".properties.pccRules[].serviceDataFlowTemplates") + if service_data_flow_templates is not None: + service_data_flow_templates.set_elements(AAZObjectType, ".") + + _elements = _builder.get(".properties.pccRules[].serviceDataFlowTemplates[]") + if _elements is not None: + _elements.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) + _elements.set_prop("ports", AAZListType, ".ports") + _elements.set_prop("protocol", AAZListType, ".protocol", typ_kwargs={"flags": {"required": True}}) + _elements.set_prop("remoteIpList", AAZListType, ".remote_ip_list", typ_kwargs={"flags": {"required": True}}) + _elements.set_prop("templateName", AAZStrType, ".template_name", typ_kwargs={"flags": {"required": True}}) + + ports = _builder.get(".properties.pccRules[].serviceDataFlowTemplates[].ports") + if ports is not None: + ports.set_elements(AAZStrType, ".") + + protocol = _builder.get(".properties.pccRules[].serviceDataFlowTemplates[].protocol") + if protocol is not None: + protocol.set_elements(AAZStrType, ".") + + remote_ip_list = _builder.get(".properties.pccRules[].serviceDataFlowTemplates[].remoteIpList") + if remote_ip_list is not None: + remote_ip_list.set_elements(AAZStrType, ".") + + service_qos_policy = _builder.get(".properties.serviceQosPolicy") + if service_qos_policy is not None: + service_qos_policy.set_prop("5qi", AAZIntType, ".five_qi") + service_qos_policy.set_prop("allocationAndRetentionPriorityLevel", AAZIntType, ".allocation_and_retention_priority_level") + _UpdateHelper._build_schema_ambr_update(service_qos_policy.set_prop("maximumBitRate", AAZObjectType, ".maximum_bit_rate", typ_kwargs={"flags": {"required": True}})) + service_qos_policy.set_prop("preemptionCapability", AAZStrType, ".preemption_capability") + service_qos_policy.set_prop("preemptionVulnerability", AAZStrType, ".preemption_vulnerability") + + tags = _builder.get(".tags") + if tags is not None: + tags.set_elements(AAZStrType, ".") + + return _instance_value + + class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): + + def __call__(self, *args, **kwargs): + self._update_instance_by_generic( + self.ctx.vars.instance, + self.ctx.generic_update_args + ) + + +class _UpdateHelper: + """Helper class for Update""" + + @classmethod + def _build_schema_ambr_update(cls, _builder): + if _builder is None: + return + _builder.set_prop("downlink", AAZStrType, ".downlink", typ_kwargs={"flags": {"required": True}}) + _builder.set_prop("uplink", AAZStrType, ".uplink", typ_kwargs={"flags": {"required": True}}) + + _schema_ambr_read = None + + @classmethod + def _build_schema_ambr_read(cls, _schema): + if cls._schema_ambr_read is not None: + _schema.downlink = cls._schema_ambr_read.downlink + _schema.uplink = cls._schema_ambr_read.uplink + return + + cls._schema_ambr_read = _schema_ambr_read = AAZObjectType() + + ambr_read = _schema_ambr_read + ambr_read.downlink = AAZStrType( + flags={"required": True}, + ) + ambr_read.uplink = AAZStrType( + flags={"required": True}, + ) + + _schema.downlink = cls._schema_ambr_read.downlink + _schema.uplink = cls._schema_ambr_read.uplink + + _schema_service_read = None + + @classmethod + def _build_schema_service_read(cls, _schema): + if cls._schema_service_read is not None: + _schema.id = cls._schema_service_read.id + _schema.location = cls._schema_service_read.location + _schema.name = cls._schema_service_read.name + _schema.properties = cls._schema_service_read.properties + _schema.system_data = cls._schema_service_read.system_data + _schema.tags = cls._schema_service_read.tags + _schema.type = cls._schema_service_read.type + return + + cls._schema_service_read = _schema_service_read = AAZObjectType() + + service_read = _schema_service_read + service_read.id = AAZStrType( + flags={"read_only": True}, + ) + service_read.location = AAZStrType( + flags={"required": True}, + ) + service_read.name = AAZStrType( + flags={"read_only": True}, + ) + service_read.properties = AAZObjectType( + flags={"required": True, "client_flatten": True}, + ) + service_read.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + service_read.tags = AAZDictType() + service_read.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = _schema_service_read.properties + properties.pcc_rules = AAZListType( + serialized_name="pccRules", + flags={"required": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.service_precedence = AAZIntType( + serialized_name="servicePrecedence", + flags={"required": True}, + ) + properties.service_qos_policy = AAZObjectType( + serialized_name="serviceQosPolicy", + ) + + pcc_rules = _schema_service_read.properties.pcc_rules + pcc_rules.Element = AAZObjectType() + + _element = _schema_service_read.properties.pcc_rules.Element + _element.rule_name = AAZStrType( + serialized_name="ruleName", + flags={"required": True}, + ) + _element.rule_precedence = AAZIntType( + serialized_name="rulePrecedence", + flags={"required": True}, + ) + _element.rule_qos_policy = AAZObjectType( + serialized_name="ruleQosPolicy", + ) + _element.service_data_flow_templates = AAZListType( + serialized_name="serviceDataFlowTemplates", + flags={"required": True}, + ) + _element.traffic_control = AAZStrType( + serialized_name="trafficControl", + ) + + rule_qos_policy = _schema_service_read.properties.pcc_rules.Element.rule_qos_policy + rule_qos_policy["5qi"] = AAZIntType() + rule_qos_policy.allocation_and_retention_priority_level = AAZIntType( + serialized_name="allocationAndRetentionPriorityLevel", + ) + rule_qos_policy.guaranteed_bit_rate = AAZObjectType( + serialized_name="guaranteedBitRate", + ) + cls._build_schema_ambr_read(rule_qos_policy.guaranteed_bit_rate) + rule_qos_policy.maximum_bit_rate = AAZObjectType( + serialized_name="maximumBitRate", + flags={"required": True}, + ) + cls._build_schema_ambr_read(rule_qos_policy.maximum_bit_rate) + rule_qos_policy.preemption_capability = AAZStrType( + serialized_name="preemptionCapability", + ) + rule_qos_policy.preemption_vulnerability = AAZStrType( + serialized_name="preemptionVulnerability", + ) + + service_data_flow_templates = _schema_service_read.properties.pcc_rules.Element.service_data_flow_templates + service_data_flow_templates.Element = AAZObjectType() + + _element = _schema_service_read.properties.pcc_rules.Element.service_data_flow_templates.Element + _element.direction = AAZStrType( + flags={"required": True}, + ) + _element.ports = AAZListType() + _element.protocol = AAZListType( + flags={"required": True}, + ) + _element.remote_ip_list = AAZListType( + serialized_name="remoteIpList", + flags={"required": True}, + ) + _element.template_name = AAZStrType( + serialized_name="templateName", + flags={"required": True}, + ) + + ports = _schema_service_read.properties.pcc_rules.Element.service_data_flow_templates.Element.ports + ports.Element = AAZStrType() + + protocol = _schema_service_read.properties.pcc_rules.Element.service_data_flow_templates.Element.protocol + protocol.Element = AAZStrType() + + remote_ip_list = _schema_service_read.properties.pcc_rules.Element.service_data_flow_templates.Element.remote_ip_list + remote_ip_list.Element = AAZStrType() + + service_qos_policy = _schema_service_read.properties.service_qos_policy + service_qos_policy["5qi"] = AAZIntType() + service_qos_policy.allocation_and_retention_priority_level = AAZIntType( + serialized_name="allocationAndRetentionPriorityLevel", + ) + service_qos_policy.maximum_bit_rate = AAZObjectType( + serialized_name="maximumBitRate", + flags={"required": True}, + ) + cls._build_schema_ambr_read(service_qos_policy.maximum_bit_rate) + service_qos_policy.preemption_capability = AAZStrType( + serialized_name="preemptionCapability", + ) + service_qos_policy.preemption_vulnerability = AAZStrType( + serialized_name="preemptionVulnerability", + ) + + system_data = _schema_service_read.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = _schema_service_read.tags + tags.Element = AAZStrType() + + _schema.id = cls._schema_service_read.id + _schema.location = cls._schema_service_read.location + _schema.name = cls._schema_service_read.name + _schema.properties = cls._schema_service_read.properties + _schema.system_data = cls._schema_service_read.system_data + _schema.tags = cls._schema_service_read.tags + _schema.type = cls._schema_service_read.type + + +__all__ = ["Update"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/service/_wait.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/service/_wait.py new file mode 100644 index 00000000000..85ad56660b3 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/service/_wait.py @@ -0,0 +1,350 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network service wait", +) +class Wait(AAZWaitCommand): + """Place the CLI in a waiting state until a condition is met. + """ + + _aaz_info = { + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/mobilenetworks/{}/services/{}", "2022-11-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.mobile_network_name = AAZStrArg( + options=["--mobile-network-name"], + help="The name of the mobile network.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.service_name = AAZStrArg( + options=["-n", "--name", "--service-name"], + help="The name of the service. You must not use any of the following reserved strings - `default`, `requested` or `service`", + required=True, + id_part="child_name_1", + fmt=AAZStrArgFormat( + pattern="^(?!(default|requested|service)$)[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.ServicesGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) + return result + + class ServicesGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/mobileNetworks/{mobileNetworkName}/services/{serviceName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "mobileNetworkName", self.ctx.args.mobile_network_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "serviceName", self.ctx.args.service_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.location = AAZStrType( + flags={"required": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType( + flags={"required": True, "client_flatten": True}, + ) + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.pcc_rules = AAZListType( + serialized_name="pccRules", + flags={"required": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.service_precedence = AAZIntType( + serialized_name="servicePrecedence", + flags={"required": True}, + ) + properties.service_qos_policy = AAZObjectType( + serialized_name="serviceQosPolicy", + ) + + pcc_rules = cls._schema_on_200.properties.pcc_rules + pcc_rules.Element = AAZObjectType() + + _element = cls._schema_on_200.properties.pcc_rules.Element + _element.rule_name = AAZStrType( + serialized_name="ruleName", + flags={"required": True}, + ) + _element.rule_precedence = AAZIntType( + serialized_name="rulePrecedence", + flags={"required": True}, + ) + _element.rule_qos_policy = AAZObjectType( + serialized_name="ruleQosPolicy", + ) + _element.service_data_flow_templates = AAZListType( + serialized_name="serviceDataFlowTemplates", + flags={"required": True}, + ) + _element.traffic_control = AAZStrType( + serialized_name="trafficControl", + ) + + rule_qos_policy = cls._schema_on_200.properties.pcc_rules.Element.rule_qos_policy + rule_qos_policy["5qi"] = AAZIntType() + rule_qos_policy.allocation_and_retention_priority_level = AAZIntType( + serialized_name="allocationAndRetentionPriorityLevel", + ) + rule_qos_policy.guaranteed_bit_rate = AAZObjectType( + serialized_name="guaranteedBitRate", + ) + _WaitHelper._build_schema_ambr_read(rule_qos_policy.guaranteed_bit_rate) + rule_qos_policy.maximum_bit_rate = AAZObjectType( + serialized_name="maximumBitRate", + flags={"required": True}, + ) + _WaitHelper._build_schema_ambr_read(rule_qos_policy.maximum_bit_rate) + rule_qos_policy.preemption_capability = AAZStrType( + serialized_name="preemptionCapability", + ) + rule_qos_policy.preemption_vulnerability = AAZStrType( + serialized_name="preemptionVulnerability", + ) + + service_data_flow_templates = cls._schema_on_200.properties.pcc_rules.Element.service_data_flow_templates + service_data_flow_templates.Element = AAZObjectType() + + _element = cls._schema_on_200.properties.pcc_rules.Element.service_data_flow_templates.Element + _element.direction = AAZStrType( + flags={"required": True}, + ) + _element.ports = AAZListType() + _element.protocol = AAZListType( + flags={"required": True}, + ) + _element.remote_ip_list = AAZListType( + serialized_name="remoteIpList", + flags={"required": True}, + ) + _element.template_name = AAZStrType( + serialized_name="templateName", + flags={"required": True}, + ) + + ports = cls._schema_on_200.properties.pcc_rules.Element.service_data_flow_templates.Element.ports + ports.Element = AAZStrType() + + protocol = cls._schema_on_200.properties.pcc_rules.Element.service_data_flow_templates.Element.protocol + protocol.Element = AAZStrType() + + remote_ip_list = cls._schema_on_200.properties.pcc_rules.Element.service_data_flow_templates.Element.remote_ip_list + remote_ip_list.Element = AAZStrType() + + service_qos_policy = cls._schema_on_200.properties.service_qos_policy + service_qos_policy["5qi"] = AAZIntType() + service_qos_policy.allocation_and_retention_priority_level = AAZIntType( + serialized_name="allocationAndRetentionPriorityLevel", + ) + service_qos_policy.maximum_bit_rate = AAZObjectType( + serialized_name="maximumBitRate", + flags={"required": True}, + ) + _WaitHelper._build_schema_ambr_read(service_qos_policy.maximum_bit_rate) + service_qos_policy.preemption_capability = AAZStrType( + serialized_name="preemptionCapability", + ) + service_qos_policy.preemption_vulnerability = AAZStrType( + serialized_name="preemptionVulnerability", + ) + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _WaitHelper: + """Helper class for Wait""" + + _schema_ambr_read = None + + @classmethod + def _build_schema_ambr_read(cls, _schema): + if cls._schema_ambr_read is not None: + _schema.downlink = cls._schema_ambr_read.downlink + _schema.uplink = cls._schema_ambr_read.uplink + return + + cls._schema_ambr_read = _schema_ambr_read = AAZObjectType() + + ambr_read = _schema_ambr_read + ambr_read.downlink = AAZStrType( + flags={"required": True}, + ) + ambr_read.uplink = AAZStrType( + flags={"required": True}, + ) + + _schema.downlink = cls._schema_ambr_read.downlink + _schema.uplink = cls._schema_ambr_read.uplink + + +__all__ = ["Wait"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/__cmd_group.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/__cmd_group.py new file mode 100644 index 00000000000..3b193f58c2a --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/__cmd_group.py @@ -0,0 +1,23 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command_group( + "mobile-network sim", +) +class __CMDGroup(AAZCommandGroup): + """Manage sim + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/__init__.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/__init__.py new file mode 100644 index 00000000000..2d1a2078686 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/__init__.py @@ -0,0 +1,16 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * +from ._create import * +from ._delete import * +from ._list import * +from ._show import * +from ._wait import * diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/_create.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/_create.py new file mode 100644 index 00000000000..c1cfec7c6aa --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/_create.py @@ -0,0 +1,469 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network sim create", +) +class Create(AAZCommand): + """Create a SIM. + + :example: Create sim + az mobile-network sim create -g rg --sim-group-name sim-group-name -n sim-name --international-msi 0000000000 --operator-key-code 00000000000000000000000000000000 --authentication-key 00000000000000000000000000000000 + """ + + _aaz_info = { + "version": "2022-11-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/simgroups/{}/sims/{}", "2022-11-01"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.sim_group_name = AAZStrArg( + options=["--sim-group-name"], + help="The name of the SIM Group.", + required=True, + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.sim_name = AAZStrArg( + options=["-n", "--name", "--sim-name"], + help="The name of the SIM.", + required=True, + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.authentication_key = AAZStrArg( + options=["--authentication-key"], + arg_group="Properties", + help="The Ki value for the SIM.", + fmt=AAZStrArgFormat( + pattern="^[0-9a-fA-F]{32}$", + ), + ) + _args_schema.device_type = AAZStrArg( + options=["--device-type"], + arg_group="Properties", + help="An optional free-form text field that can be used to record the device type this SIM is associated with, for example 'Video camera'. The Azure portal allows SIMs to be grouped and filtered based on this value.", + ) + _args_schema.icc_id = AAZStrArg( + options=["--icc-id"], + arg_group="Properties", + help="The integrated circuit card ID (ICCID) for the SIM.", + fmt=AAZStrArgFormat( + pattern="^[0-9]{10,20}$", + ), + ) + _args_schema.international_msi = AAZStrArg( + options=["--international-msi"], + arg_group="Properties", + help="The international mobile subscriber identity (IMSI) for the SIM.", + required=True, + fmt=AAZStrArgFormat( + pattern="^[0-9]{5,15}$", + ), + ) + _args_schema.operator_key_code = AAZStrArg( + options=["--operator-key-code"], + arg_group="Properties", + help="The Opc value for the SIM.", + fmt=AAZStrArgFormat( + pattern="^[0-9a-fA-F]{32}$", + ), + ) + _args_schema.sim_policy = AAZObjectArg( + options=["--sim-policy"], + arg_group="Properties", + help="The SIM policy used by this SIM.", + ) + _args_schema.static_ip_config = AAZListArg( + options=["--static-ip-config"], + arg_group="Properties", + help="A list of static IP addresses assigned to this SIM. Each address is assigned at a defined network scope, made up of {attached data network, slice}.", + fmt=AAZListArgFormat( + unique=True, + ), + ) + + sim_policy = cls._args_schema.sim_policy + sim_policy.id = AAZStrArg( + options=["id"], + help="SIM policy resource ID.", + required=True, + fmt=AAZStrArgFormat( + pattern="^/[sS][uU][bB][sS][cC][rR][iI][pP][tT][iI][oO][nN][sS]/[^/?#]+/[rR][eE][sS][oO][uU][rR][cC][eE][gG][rR][oO][uU][pP][sS]/[^/?#]+/[pP][rR][oO][vV][iI][dD][eE][rR][sS]/[mM][iI][cC][rR][oO][sS][oO][fF][tT]\.[mM][oO][bB][iI][lL][eE][nN][eE][tT][wW][oO][rR][kK]/[mM][oO][bB][iI][lL][eE][nN][eE][tT][wW][oO][rR][kK][sS]/[^/?#]+/[sS][iI][mM][pP][oO][lL][iI][cC][iI][eE][sS]/[^/?#]+$", + ), + ) + + static_ip_config = cls._args_schema.static_ip_config + static_ip_config.Element = AAZObjectArg() + + _element = cls._args_schema.static_ip_config.Element + _element.attached_data_network = AAZObjectArg( + options=["attached-data-network"], + help="The attached data network on which the static IP address will be used. The combination of attached data network and slice defines the network scope of the IP address.", + ) + _element.slice = AAZObjectArg( + options=["slice"], + help="The network slice on which the static IP address will be used. The combination of attached data network and slice defines the network scope of the IP address.", + ) + _element.static_ip = AAZObjectArg( + options=["static-ip"], + help="The static IP configuration for the SIM to use at the defined network scope.", + ) + + attached_data_network = cls._args_schema.static_ip_config.Element.attached_data_network + attached_data_network.id = AAZStrArg( + options=["id"], + help="Attached data network resource ID.", + required=True, + fmt=AAZStrArgFormat( + pattern="^/[sS][uU][bB][sS][cC][rR][iI][pP][tT][iI][oO][nN][sS]/[^/?#]+/[rR][eE][sS][oO][uU][rR][cC][eE][gG][rR][oO][uU][pP][sS]/[^/?#]+/[pP][rR][oO][vV][iI][dD][eE][rR][sS]/[mM][iI][cC][rR][oO][sS][oO][fF][tT]\.[mM][oO][bB][iI][lL][eE][nN][eE][tT][wW][oO][rR][kK]/[pP][aA][cC][kK][eE][tT][cC][oO][rR][eE][cC][oO][nN][tT][rR][oO][lL][pP][lL][aA][nN][eE][sS]/[^/?#]+/[pP][aA][cC][kK][eE][tT][cC][oO][rR][eE][dD][aA][tT][aA][pP][lL][aA][nN][eE][sS]/[^/?#]+/[aA][tT][tT][aA][cC][hH][eE][dD][dD][aA][tT][aA][nN][eE][tT][wW][oO][rR][kK][sS]/[^/?#]+$", + ), + ) + + slice = cls._args_schema.static_ip_config.Element.slice + slice.id = AAZStrArg( + options=["id"], + help="Slice resource ID.", + required=True, + fmt=AAZStrArgFormat( + pattern="^/[sS][uU][bB][sS][cC][rR][iI][pP][tT][iI][oO][nN][sS]/[^/?#]+/[rR][eE][sS][oO][uU][rR][cC][eE][gG][rR][oO][uU][pP][sS]/[^/?#]+/[pP][rR][oO][vV][iI][dD][eE][rR][sS]/[mM][iI][cC][rR][oO][sS][oO][fF][tT]\.[mM][oO][bB][iI][lL][eE][nN][eE][tT][wW][oO][rR][kK]/[mM][oO][bB][iI][lL][eE][nN][eE][tT][wW][oO][rR][kK][sS]/[^/?#]+/[sS][lL][iI][cC][eE][sS]/[^/?#]+$", + ), + ) + + static_ip = cls._args_schema.static_ip_config.Element.static_ip + static_ip.ipv4_address = AAZStrArg( + options=["ipv4-address"], + help="The IPv4 address assigned to the SIM at this network scope. This address must be in the userEquipmentStaticAddressPoolPrefix defined in the attached data network.", + fmt=AAZStrArgFormat( + pattern="^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$", + ), + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + yield self.SimsCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class SimsCreateOrUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200, 201]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/simGroups/{simGroupName}/sims/{simName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "simGroupName", self.ctx.args.sim_group_name, + required=True, + ), + **self.serialize_url_param( + "simName", self.ctx.args.sim_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + typ=AAZObjectType, + typ_kwargs={"flags": {"required": True, "client_flatten": True}} + ) + _builder.set_prop("properties", AAZObjectType, ".", typ_kwargs={"flags": {"required": True, "client_flatten": True}}) + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("authenticationKey", AAZStrType, ".authentication_key") + properties.set_prop("deviceType", AAZStrType, ".device_type") + properties.set_prop("integratedCircuitCardIdentifier", AAZStrType, ".icc_id") + properties.set_prop("internationalMobileSubscriberIdentity", AAZStrType, ".international_msi", typ_kwargs={"flags": {"required": True}}) + properties.set_prop("operatorKeyCode", AAZStrType, ".operator_key_code") + properties.set_prop("simPolicy", AAZObjectType, ".sim_policy") + properties.set_prop("staticIpConfiguration", AAZListType, ".static_ip_config") + + sim_policy = _builder.get(".properties.simPolicy") + if sim_policy is not None: + sim_policy.set_prop("id", AAZStrType, ".id", typ_kwargs={"flags": {"required": True}}) + + static_ip_configuration = _builder.get(".properties.staticIpConfiguration") + if static_ip_configuration is not None: + static_ip_configuration.set_elements(AAZObjectType, ".") + + _elements = _builder.get(".properties.staticIpConfiguration[]") + if _elements is not None: + _elements.set_prop("attachedDataNetwork", AAZObjectType, ".attached_data_network") + _elements.set_prop("slice", AAZObjectType, ".slice") + _elements.set_prop("staticIp", AAZObjectType, ".static_ip") + + attached_data_network = _builder.get(".properties.staticIpConfiguration[].attachedDataNetwork") + if attached_data_network is not None: + attached_data_network.set_prop("id", AAZStrType, ".id", typ_kwargs={"flags": {"required": True}}) + + slice = _builder.get(".properties.staticIpConfiguration[].slice") + if slice is not None: + slice.set_prop("id", AAZStrType, ".id", typ_kwargs={"flags": {"required": True}}) + + static_ip = _builder.get(".properties.staticIpConfiguration[].staticIp") + if static_ip is not None: + static_ip.set_prop("ipv4Address", AAZStrType, ".ipv4_address") + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + + _schema_on_200_201 = cls._schema_on_200_201 + _schema_on_200_201.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.properties = AAZObjectType( + flags={"required": True, "client_flatten": True}, + ) + _schema_on_200_201.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200_201.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200_201.properties + properties.device_type = AAZStrType( + serialized_name="deviceType", + ) + properties.integrated_circuit_card_identifier = AAZStrType( + serialized_name="integratedCircuitCardIdentifier", + ) + properties.international_mobile_subscriber_identity = AAZStrType( + serialized_name="internationalMobileSubscriberIdentity", + flags={"required": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.sim_policy = AAZObjectType( + serialized_name="simPolicy", + ) + properties.sim_state = AAZStrType( + serialized_name="simState", + flags={"read_only": True}, + ) + properties.site_provisioning_state = AAZDictType( + serialized_name="siteProvisioningState", + flags={"read_only": True}, + ) + properties.static_ip_configuration = AAZListType( + serialized_name="staticIpConfiguration", + ) + properties.vendor_key_fingerprint = AAZStrType( + serialized_name="vendorKeyFingerprint", + flags={"read_only": True}, + ) + properties.vendor_name = AAZStrType( + serialized_name="vendorName", + flags={"read_only": True}, + ) + + sim_policy = cls._schema_on_200_201.properties.sim_policy + sim_policy.id = AAZStrType( + flags={"required": True}, + ) + + site_provisioning_state = cls._schema_on_200_201.properties.site_provisioning_state + site_provisioning_state.Element = AAZStrType( + flags={"read_only": True}, + ) + + static_ip_configuration = cls._schema_on_200_201.properties.static_ip_configuration + static_ip_configuration.Element = AAZObjectType() + + _element = cls._schema_on_200_201.properties.static_ip_configuration.Element + _element.attached_data_network = AAZObjectType( + serialized_name="attachedDataNetwork", + ) + _element.slice = AAZObjectType() + _element.static_ip = AAZObjectType( + serialized_name="staticIp", + ) + + attached_data_network = cls._schema_on_200_201.properties.static_ip_configuration.Element.attached_data_network + attached_data_network.id = AAZStrType( + flags={"required": True}, + ) + + slice = cls._schema_on_200_201.properties.static_ip_configuration.Element.slice + slice.id = AAZStrType( + flags={"required": True}, + ) + + static_ip = cls._schema_on_200_201.properties.static_ip_configuration.Element.static_ip + static_ip.ipv4_address = AAZStrType( + serialized_name="ipv4Address", + ) + + system_data = cls._schema_on_200_201.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + return cls._schema_on_200_201 + + +class _CreateHelper: + """Helper class for Create""" + + +__all__ = ["Create"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/_delete.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/_delete.py new file mode 100644 index 00000000000..a68b51ebb8f --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/_delete.py @@ -0,0 +1,181 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network sim delete", + confirmation="Are you sure you want to perform this operation?", +) +class Delete(AAZCommand): + """Delete the specified SIM. + + :example: Delete sim + az mobile-network sim delete -g rg -n sim-name --sim-group-name sim-group-name -y + """ + + _aaz_info = { + "version": "2022-11-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/simgroups/{}/sims/{}", "2022-11-01"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, None) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.sim_group_name = AAZStrArg( + options=["--sim-group-name"], + help="The name of the SIM Group.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.sim_name = AAZStrArg( + options=["-n", "--name", "--sim-name"], + help="The name of the SIM.", + required=True, + id_part="child_name_1", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + yield self.SimsDelete(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + class SimsDelete(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [204]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_204, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/simGroups/{simGroupName}/sims/{simName}", + **self.url_parameters + ) + + @property + def method(self): + return "DELETE" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "simGroupName", self.ctx.args.sim_group_name, + required=True, + ), + **self.serialize_url_param( + "simName", self.ctx.args.sim_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + def on_200(self, session): + pass + + def on_204(self, session): + pass + + +class _DeleteHelper: + """Helper class for Delete""" + + +__all__ = ["Delete"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/_list.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/_list.py new file mode 100644 index 00000000000..3aa3edd4119 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/_list.py @@ -0,0 +1,288 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network sim list", +) +class List(AAZCommand): + """List all the SIMs in a SIM group. + + :example: List sims by resource group + az mobile-network sim list -g rg --sim-group-name sim-group-name + """ + + _aaz_info = { + "version": "2022-11-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/simgroups/{}/sims", "2022-11-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_paging(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.sim_group_name = AAZStrArg( + options=["--sim-group-name"], + help="The name of the SIM Group.", + required=True, + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.SimsListByGroup(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) + next_link = self.deserialize_output(self.ctx.vars.instance.next_link) + return result, next_link + + class SimsListByGroup(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/simGroups/{simGroupName}/sims", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "simGroupName", self.ctx.args.sim_group_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.next_link = AAZStrType( + serialized_name="nextLink", + flags={"read_only": True}, + ) + _schema_on_200.value = AAZListType() + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType( + flags={"required": True, "client_flatten": True}, + ) + _element.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.device_type = AAZStrType( + serialized_name="deviceType", + ) + properties.integrated_circuit_card_identifier = AAZStrType( + serialized_name="integratedCircuitCardIdentifier", + ) + properties.international_mobile_subscriber_identity = AAZStrType( + serialized_name="internationalMobileSubscriberIdentity", + flags={"required": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.sim_policy = AAZObjectType( + serialized_name="simPolicy", + ) + properties.sim_state = AAZStrType( + serialized_name="simState", + flags={"read_only": True}, + ) + properties.site_provisioning_state = AAZDictType( + serialized_name="siteProvisioningState", + flags={"read_only": True}, + ) + properties.static_ip_configuration = AAZListType( + serialized_name="staticIpConfiguration", + ) + properties.vendor_key_fingerprint = AAZStrType( + serialized_name="vendorKeyFingerprint", + flags={"read_only": True}, + ) + properties.vendor_name = AAZStrType( + serialized_name="vendorName", + flags={"read_only": True}, + ) + + sim_policy = cls._schema_on_200.value.Element.properties.sim_policy + sim_policy.id = AAZStrType( + flags={"required": True}, + ) + + site_provisioning_state = cls._schema_on_200.value.Element.properties.site_provisioning_state + site_provisioning_state.Element = AAZStrType( + flags={"read_only": True}, + ) + + static_ip_configuration = cls._schema_on_200.value.Element.properties.static_ip_configuration + static_ip_configuration.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element.properties.static_ip_configuration.Element + _element.attached_data_network = AAZObjectType( + serialized_name="attachedDataNetwork", + ) + _element.slice = AAZObjectType() + _element.static_ip = AAZObjectType( + serialized_name="staticIp", + ) + + attached_data_network = cls._schema_on_200.value.Element.properties.static_ip_configuration.Element.attached_data_network + attached_data_network.id = AAZStrType( + flags={"required": True}, + ) + + slice = cls._schema_on_200.value.Element.properties.static_ip_configuration.Element.slice + slice.id = AAZStrType( + flags={"required": True}, + ) + + static_ip = cls._schema_on_200.value.Element.properties.static_ip_configuration.Element.static_ip + static_ip.ipv4_address = AAZStrType( + serialized_name="ipv4Address", + ) + + system_data = cls._schema_on_200.value.Element.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + return cls._schema_on_200 + + +class _ListHelper: + """Helper class for List""" + + +__all__ = ["List"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/_show.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/_show.py new file mode 100644 index 00000000000..983d4e90a7c --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/_show.py @@ -0,0 +1,293 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network sim show", +) +class Show(AAZCommand): + """Get information about the specified SIM. + + :example: Show sim + az mobile-network sim show -g rg -n sim-name --sim-group-name sim-group-name + """ + + _aaz_info = { + "version": "2022-11-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/simgroups/{}/sims/{}", "2022-11-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.sim_group_name = AAZStrArg( + options=["--sim-group-name"], + help="The name of the SIM Group.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.sim_name = AAZStrArg( + options=["-n", "--name", "--sim-name"], + help="The name of the SIM.", + required=True, + id_part="child_name_1", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.SimsGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class SimsGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/simGroups/{simGroupName}/sims/{simName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "simGroupName", self.ctx.args.sim_group_name, + required=True, + ), + **self.serialize_url_param( + "simName", self.ctx.args.sim_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType( + flags={"required": True, "client_flatten": True}, + ) + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.device_type = AAZStrType( + serialized_name="deviceType", + ) + properties.integrated_circuit_card_identifier = AAZStrType( + serialized_name="integratedCircuitCardIdentifier", + ) + properties.international_mobile_subscriber_identity = AAZStrType( + serialized_name="internationalMobileSubscriberIdentity", + flags={"required": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.sim_policy = AAZObjectType( + serialized_name="simPolicy", + ) + properties.sim_state = AAZStrType( + serialized_name="simState", + flags={"read_only": True}, + ) + properties.site_provisioning_state = AAZDictType( + serialized_name="siteProvisioningState", + flags={"read_only": True}, + ) + properties.static_ip_configuration = AAZListType( + serialized_name="staticIpConfiguration", + ) + properties.vendor_key_fingerprint = AAZStrType( + serialized_name="vendorKeyFingerprint", + flags={"read_only": True}, + ) + properties.vendor_name = AAZStrType( + serialized_name="vendorName", + flags={"read_only": True}, + ) + + sim_policy = cls._schema_on_200.properties.sim_policy + sim_policy.id = AAZStrType( + flags={"required": True}, + ) + + site_provisioning_state = cls._schema_on_200.properties.site_provisioning_state + site_provisioning_state.Element = AAZStrType( + flags={"read_only": True}, + ) + + static_ip_configuration = cls._schema_on_200.properties.static_ip_configuration + static_ip_configuration.Element = AAZObjectType() + + _element = cls._schema_on_200.properties.static_ip_configuration.Element + _element.attached_data_network = AAZObjectType( + serialized_name="attachedDataNetwork", + ) + _element.slice = AAZObjectType() + _element.static_ip = AAZObjectType( + serialized_name="staticIp", + ) + + attached_data_network = cls._schema_on_200.properties.static_ip_configuration.Element.attached_data_network + attached_data_network.id = AAZStrType( + flags={"required": True}, + ) + + slice = cls._schema_on_200.properties.static_ip_configuration.Element.slice + slice.id = AAZStrType( + flags={"required": True}, + ) + + static_ip = cls._schema_on_200.properties.static_ip_configuration.Element.static_ip + static_ip.ipv4_address = AAZStrType( + serialized_name="ipv4Address", + ) + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + return cls._schema_on_200 + + +class _ShowHelper: + """Helper class for Show""" + + +__all__ = ["Show"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/_wait.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/_wait.py new file mode 100644 index 00000000000..0244f7e665a --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/_wait.py @@ -0,0 +1,289 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network sim wait", +) +class Wait(AAZWaitCommand): + """Place the CLI in a waiting state until a condition is met. + """ + + _aaz_info = { + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/simgroups/{}/sims/{}", "2022-11-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.sim_group_name = AAZStrArg( + options=["--sim-group-name"], + help="The name of the SIM Group.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.sim_name = AAZStrArg( + options=["-n", "--name", "--sim-name"], + help="The name of the SIM.", + required=True, + id_part="child_name_1", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.SimsGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) + return result + + class SimsGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/simGroups/{simGroupName}/sims/{simName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "simGroupName", self.ctx.args.sim_group_name, + required=True, + ), + **self.serialize_url_param( + "simName", self.ctx.args.sim_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType( + flags={"required": True, "client_flatten": True}, + ) + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.device_type = AAZStrType( + serialized_name="deviceType", + ) + properties.integrated_circuit_card_identifier = AAZStrType( + serialized_name="integratedCircuitCardIdentifier", + ) + properties.international_mobile_subscriber_identity = AAZStrType( + serialized_name="internationalMobileSubscriberIdentity", + flags={"required": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.sim_policy = AAZObjectType( + serialized_name="simPolicy", + ) + properties.sim_state = AAZStrType( + serialized_name="simState", + flags={"read_only": True}, + ) + properties.site_provisioning_state = AAZDictType( + serialized_name="siteProvisioningState", + flags={"read_only": True}, + ) + properties.static_ip_configuration = AAZListType( + serialized_name="staticIpConfiguration", + ) + properties.vendor_key_fingerprint = AAZStrType( + serialized_name="vendorKeyFingerprint", + flags={"read_only": True}, + ) + properties.vendor_name = AAZStrType( + serialized_name="vendorName", + flags={"read_only": True}, + ) + + sim_policy = cls._schema_on_200.properties.sim_policy + sim_policy.id = AAZStrType( + flags={"required": True}, + ) + + site_provisioning_state = cls._schema_on_200.properties.site_provisioning_state + site_provisioning_state.Element = AAZStrType( + flags={"read_only": True}, + ) + + static_ip_configuration = cls._schema_on_200.properties.static_ip_configuration + static_ip_configuration.Element = AAZObjectType() + + _element = cls._schema_on_200.properties.static_ip_configuration.Element + _element.attached_data_network = AAZObjectType( + serialized_name="attachedDataNetwork", + ) + _element.slice = AAZObjectType() + _element.static_ip = AAZObjectType( + serialized_name="staticIp", + ) + + attached_data_network = cls._schema_on_200.properties.static_ip_configuration.Element.attached_data_network + attached_data_network.id = AAZStrType( + flags={"required": True}, + ) + + slice = cls._schema_on_200.properties.static_ip_configuration.Element.slice + slice.id = AAZStrType( + flags={"required": True}, + ) + + static_ip = cls._schema_on_200.properties.static_ip_configuration.Element.static_ip + static_ip.ipv4_address = AAZStrType( + serialized_name="ipv4Address", + ) + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + return cls._schema_on_200 + + +class _WaitHelper: + """Helper class for Wait""" + + +__all__ = ["Wait"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/group/__cmd_group.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/group/__cmd_group.py new file mode 100644 index 00000000000..91f09a1fbb2 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/group/__cmd_group.py @@ -0,0 +1,23 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command_group( + "mobile-network sim group", +) +class __CMDGroup(AAZCommandGroup): + """Manage sim group + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/group/__init__.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/group/__init__.py new file mode 100644 index 00000000000..db73033039b --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/group/__init__.py @@ -0,0 +1,17 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * +from ._create import * +from ._delete import * +from ._list import * +from ._show import * +from ._update import * +from ._wait import * diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/group/_create.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/group/_create.py new file mode 100644 index 00000000000..c7618c24230 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/group/_create.py @@ -0,0 +1,394 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network sim group create", +) +class Create(AAZCommand): + """Create a SIM group. + + :example: Create sim group + az mobile-network sim group create -n sim-group-name -g rg --mobile-network "{id:mobile-network-id}" + """ + + _aaz_info = { + "version": "2022-11-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/simgroups/{}", "2022-11-01"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.sim_group_name = AAZStrArg( + options=["-n", "--name", "--sim-group-name"], + help="The name of the SIM Group.", + required=True, + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + + # define Arg Group "Parameters" + + _args_schema = cls._args_schema + _args_schema.identity = AAZObjectArg( + options=["--identity"], + arg_group="Parameters", + help="The identity used to retrieve the encryption key from Azure key vault.", + ) + _args_schema.location = AAZResourceLocationArg( + arg_group="Parameters", + help="The geo-location where the resource lives", + required=True, + fmt=AAZResourceLocationArgFormat( + resource_group_arg="resource_group", + ), + ) + _args_schema.tags = AAZDictArg( + options=["--tags"], + arg_group="Parameters", + help="Resource tags.", + ) + + identity = cls._args_schema.identity + identity.type = AAZStrArg( + options=["type"], + help="Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).", + required=True, + enum={"None": "None", "SystemAssigned": "SystemAssigned", "SystemAssigned,UserAssigned": "SystemAssigned,UserAssigned", "UserAssigned": "UserAssigned"}, + ) + identity.user_assigned_identities = AAZDictArg( + options=["user-assigned-identities"], + help="The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests.", + ) + + user_assigned_identities = cls._args_schema.identity.user_assigned_identities + user_assigned_identities.Element = AAZObjectArg( + blank={}, + ) + + tags = cls._args_schema.tags + tags.Element = AAZStrArg() + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.encryption_key = AAZObjectArg( + options=["--encryption-key"], + arg_group="Properties", + help="A key to encrypt the SIM data that belongs to this SIM group.", + ) + _args_schema.mobile_network = AAZObjectArg( + options=["--mobile-network"], + arg_group="Properties", + help="Mobile network that this SIM belongs to", + ) + + encryption_key = cls._args_schema.encryption_key + encryption_key.key_url = AAZStrArg( + options=["key-url"], + help="The key URL, unversioned. For example: https://contosovault.vault.azure.net/keys/azureKey.", + ) + + mobile_network = cls._args_schema.mobile_network + mobile_network.id = AAZStrArg( + options=["id"], + help="Mobile network resource ID.", + required=True, + fmt=AAZStrArgFormat( + pattern="^/[sS][uU][bB][sS][cC][rR][iI][pP][tT][iI][oO][nN][sS]/[^/?#]+/[rR][eE][sS][oO][uU][rR][cC][eE][gG][rR][oO][uU][pP][sS]/[^/?#]+/[pP][rR][oO][vV][iI][dD][eE][rR][sS]/[mM][iI][cC][rR][oO][sS][oO][fF][tT]\.[mM][oO][bB][iI][lL][eE][nN][eE][tT][wW][oO][rR][kK]/[mM][oO][bB][iI][lL][eE][nN][eE][tT][wW][oO][rR][kK][sS]/[^/?#]+$", + ), + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + yield self.SimGroupsCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class SimGroupsCreateOrUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200, 201]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/simGroups/{simGroupName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "simGroupName", self.ctx.args.sim_group_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + typ=AAZObjectType, + typ_kwargs={"flags": {"required": True, "client_flatten": True}} + ) + _builder.set_prop("identity", AAZObjectType, ".identity") + _builder.set_prop("location", AAZStrType, ".location", typ_kwargs={"flags": {"required": True}}) + _builder.set_prop("properties", AAZObjectType, ".", typ_kwargs={"flags": {"required": True, "client_flatten": True}}) + _builder.set_prop("tags", AAZDictType, ".tags") + + identity = _builder.get(".identity") + if identity is not None: + identity.set_prop("type", AAZStrType, ".type", typ_kwargs={"flags": {"required": True}}) + identity.set_prop("userAssignedIdentities", AAZDictType, ".user_assigned_identities") + + user_assigned_identities = _builder.get(".identity.userAssignedIdentities") + if user_assigned_identities is not None: + user_assigned_identities.set_elements(AAZObjectType, ".") + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("encryptionKey", AAZObjectType, ".encryption_key") + properties.set_prop("mobileNetwork", AAZObjectType, ".mobile_network") + + encryption_key = _builder.get(".properties.encryptionKey") + if encryption_key is not None: + encryption_key.set_prop("keyUrl", AAZStrType, ".key_url") + + mobile_network = _builder.get(".properties.mobileNetwork") + if mobile_network is not None: + mobile_network.set_prop("id", AAZStrType, ".id", typ_kwargs={"flags": {"required": True}}) + + tags = _builder.get(".tags") + if tags is not None: + tags.set_elements(AAZStrType, ".") + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + + _schema_on_200_201 = cls._schema_on_200_201 + _schema_on_200_201.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.identity = AAZObjectType() + _schema_on_200_201.location = AAZStrType( + flags={"required": True}, + ) + _schema_on_200_201.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.properties = AAZObjectType( + flags={"required": True, "client_flatten": True}, + ) + _schema_on_200_201.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200_201.tags = AAZDictType() + _schema_on_200_201.type = AAZStrType( + flags={"read_only": True}, + ) + + identity = cls._schema_on_200_201.identity + identity.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + identity.tenant_id = AAZStrType( + serialized_name="tenantId", + flags={"read_only": True}, + ) + identity.type = AAZStrType( + flags={"required": True}, + ) + identity.user_assigned_identities = AAZDictType( + serialized_name="userAssignedIdentities", + ) + + user_assigned_identities = cls._schema_on_200_201.identity.user_assigned_identities + user_assigned_identities.Element = AAZObjectType() + + _element = cls._schema_on_200_201.identity.user_assigned_identities.Element + _element.client_id = AAZStrType( + serialized_name="clientId", + flags={"read_only": True}, + ) + _element.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + + properties = cls._schema_on_200_201.properties + properties.encryption_key = AAZObjectType( + serialized_name="encryptionKey", + ) + properties.mobile_network = AAZObjectType( + serialized_name="mobileNetwork", + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + encryption_key = cls._schema_on_200_201.properties.encryption_key + encryption_key.key_url = AAZStrType( + serialized_name="keyUrl", + ) + + mobile_network = cls._schema_on_200_201.properties.mobile_network + mobile_network.id = AAZStrType( + flags={"required": True}, + ) + + system_data = cls._schema_on_200_201.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200_201.tags + tags.Element = AAZStrType() + + return cls._schema_on_200_201 + + +class _CreateHelper: + """Helper class for Create""" + + +__all__ = ["Create"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/group/_delete.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/group/_delete.py new file mode 100644 index 00000000000..32f7815b1e3 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/group/_delete.py @@ -0,0 +1,167 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network sim group delete", + confirmation="Are you sure you want to perform this operation?", +) +class Delete(AAZCommand): + """Delete the specified SIM group. + + :example: Delete sim group + az mobile-network sim group delete -n sim-group-name -g rg -y + """ + + _aaz_info = { + "version": "2022-11-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/simgroups/{}", "2022-11-01"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, None) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.sim_group_name = AAZStrArg( + options=["-n", "--name", "--sim-group-name"], + help="The name of the SIM Group.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + yield self.SimGroupsDelete(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + class SimGroupsDelete(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [204]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_204, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/simGroups/{simGroupName}", + **self.url_parameters + ) + + @property + def method(self): + return "DELETE" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "simGroupName", self.ctx.args.sim_group_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + def on_200(self, session): + pass + + def on_204(self, session): + pass + + +class _DeleteHelper: + """Helper class for Delete""" + + +__all__ = ["Delete"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/group/_list.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/group/_list.py new file mode 100644 index 00000000000..9c4799604f8 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/group/_list.py @@ -0,0 +1,444 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network sim group list", +) +class List(AAZCommand): + """List all the SIM groups in a subscription. + + :example: List sim group by resource group + az mobile-network sim group list -g rg + """ + + _aaz_info = { + "version": "2022-11-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/providers/microsoft.mobilenetwork/simgroups", "2022-11-01"], + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/simgroups", "2022-11-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_paging(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.resource_group = AAZResourceGroupNameArg() + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + 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.SimGroupsListBySubscription(ctx=self.ctx)() + if condition_1: + self.SimGroupsListByResourceGroup(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) + next_link = self.deserialize_output(self.ctx.vars.instance.next_link) + return result, next_link + + class SimGroupsListBySubscription(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/providers/Microsoft.MobileNetwork/simGroups", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.next_link = AAZStrType( + serialized_name="nextLink", + flags={"read_only": True}, + ) + _schema_on_200.value = AAZListType() + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.identity = AAZObjectType() + _element.location = AAZStrType( + flags={"required": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType( + flags={"required": True, "client_flatten": True}, + ) + _element.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _element.tags = AAZDictType() + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + identity = cls._schema_on_200.value.Element.identity + identity.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + identity.tenant_id = AAZStrType( + serialized_name="tenantId", + flags={"read_only": True}, + ) + identity.type = AAZStrType( + flags={"required": True}, + ) + identity.user_assigned_identities = AAZDictType( + serialized_name="userAssignedIdentities", + ) + + user_assigned_identities = cls._schema_on_200.value.Element.identity.user_assigned_identities + user_assigned_identities.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element.identity.user_assigned_identities.Element + _element.client_id = AAZStrType( + serialized_name="clientId", + flags={"read_only": True}, + ) + _element.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.encryption_key = AAZObjectType( + serialized_name="encryptionKey", + ) + properties.mobile_network = AAZObjectType( + serialized_name="mobileNetwork", + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + encryption_key = cls._schema_on_200.value.Element.properties.encryption_key + encryption_key.key_url = AAZStrType( + serialized_name="keyUrl", + ) + + mobile_network = cls._schema_on_200.value.Element.properties.mobile_network + mobile_network.id = AAZStrType( + flags={"required": True}, + ) + + system_data = cls._schema_on_200.value.Element.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.value.Element.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + class SimGroupsListByResourceGroup(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/simGroups", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @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, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.next_link = AAZStrType( + serialized_name="nextLink", + flags={"read_only": True}, + ) + _schema_on_200.value = AAZListType() + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.identity = AAZObjectType() + _element.location = AAZStrType( + flags={"required": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType( + flags={"required": True, "client_flatten": True}, + ) + _element.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _element.tags = AAZDictType() + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + identity = cls._schema_on_200.value.Element.identity + identity.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + identity.tenant_id = AAZStrType( + serialized_name="tenantId", + flags={"read_only": True}, + ) + identity.type = AAZStrType( + flags={"required": True}, + ) + identity.user_assigned_identities = AAZDictType( + serialized_name="userAssignedIdentities", + ) + + user_assigned_identities = cls._schema_on_200.value.Element.identity.user_assigned_identities + user_assigned_identities.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element.identity.user_assigned_identities.Element + _element.client_id = AAZStrType( + serialized_name="clientId", + flags={"read_only": True}, + ) + _element.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.encryption_key = AAZObjectType( + serialized_name="encryptionKey", + ) + properties.mobile_network = AAZObjectType( + serialized_name="mobileNetwork", + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + encryption_key = cls._schema_on_200.value.Element.properties.encryption_key + encryption_key.key_url = AAZStrType( + serialized_name="keyUrl", + ) + + mobile_network = cls._schema_on_200.value.Element.properties.mobile_network + mobile_network.id = AAZStrType( + flags={"required": True}, + ) + + system_data = cls._schema_on_200.value.Element.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.value.Element.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _ListHelper: + """Helper class for List""" + + +__all__ = ["List"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/group/_show.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/group/_show.py new file mode 100644 index 00000000000..49b3301aac5 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/group/_show.py @@ -0,0 +1,263 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network sim group show", +) +class Show(AAZCommand): + """Get information about the specified SIM group. + + :example: Show sim goup + az mobile-network sim group show -n sim-group-name -g rg + """ + + _aaz_info = { + "version": "2022-11-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/simgroups/{}", "2022-11-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.sim_group_name = AAZStrArg( + options=["-n", "--name", "--sim-group-name"], + help="The name of the SIM Group.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.SimGroupsGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class SimGroupsGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/simGroups/{simGroupName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "simGroupName", self.ctx.args.sim_group_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.identity = AAZObjectType() + _schema_on_200.location = AAZStrType( + flags={"required": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType( + flags={"required": True, "client_flatten": True}, + ) + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + identity = cls._schema_on_200.identity + identity.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + identity.tenant_id = AAZStrType( + serialized_name="tenantId", + flags={"read_only": True}, + ) + identity.type = AAZStrType( + flags={"required": True}, + ) + identity.user_assigned_identities = AAZDictType( + serialized_name="userAssignedIdentities", + ) + + user_assigned_identities = cls._schema_on_200.identity.user_assigned_identities + user_assigned_identities.Element = AAZObjectType() + + _element = cls._schema_on_200.identity.user_assigned_identities.Element + _element.client_id = AAZStrType( + serialized_name="clientId", + flags={"read_only": True}, + ) + _element.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.encryption_key = AAZObjectType( + serialized_name="encryptionKey", + ) + properties.mobile_network = AAZObjectType( + serialized_name="mobileNetwork", + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + encryption_key = cls._schema_on_200.properties.encryption_key + encryption_key.key_url = AAZStrType( + serialized_name="keyUrl", + ) + + mobile_network = cls._schema_on_200.properties.mobile_network + mobile_network.id = AAZStrType( + flags={"required": True}, + ) + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _ShowHelper: + """Helper class for Show""" + + +__all__ = ["Show"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/group/_update.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/group/_update.py new file mode 100644 index 00000000000..48d1abc3e71 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/group/_update.py @@ -0,0 +1,539 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network sim group update", +) +class Update(AAZCommand): + """Update a SIM group. + + :example: Update sim group tags + az mobile-network sim group update -n sim-group-name -g rg --tags "{tag:test,tag2:test2}" + """ + + _aaz_info = { + "version": "2022-11-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/simgroups/{}", "2022-11-01"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + AZ_SUPPORT_GENERIC_UPDATE = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.sim_group_name = AAZStrArg( + options=["-n", "--name", "--sim-group-name"], + help="The name of the SIM Group.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + + # define Arg Group "Parameters" + + _args_schema = cls._args_schema + _args_schema.identity = AAZObjectArg( + options=["--identity"], + arg_group="Parameters", + help="The identity used to retrieve the encryption key from Azure key vault.", + nullable=True, + ) + _args_schema.tags = AAZDictArg( + options=["--tags"], + arg_group="Parameters", + help="Resource tags.", + nullable=True, + ) + + identity = cls._args_schema.identity + identity.type = AAZStrArg( + options=["type"], + help="Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).", + enum={"None": "None", "SystemAssigned": "SystemAssigned", "SystemAssigned,UserAssigned": "SystemAssigned,UserAssigned", "UserAssigned": "UserAssigned"}, + ) + identity.user_assigned_identities = AAZDictArg( + options=["user-assigned-identities"], + help="The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests.", + nullable=True, + ) + + user_assigned_identities = cls._args_schema.identity.user_assigned_identities + user_assigned_identities.Element = AAZObjectArg( + nullable=True, + blank={}, + ) + + tags = cls._args_schema.tags + tags.Element = AAZStrArg( + nullable=True, + ) + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.encryption_key = AAZObjectArg( + options=["--encryption-key"], + arg_group="Properties", + help="A key to encrypt the SIM data that belongs to this SIM group.", + nullable=True, + ) + _args_schema.mobile_network = AAZObjectArg( + options=["--mobile-network"], + arg_group="Properties", + help="Mobile network that this SIM belongs to", + nullable=True, + ) + + encryption_key = cls._args_schema.encryption_key + encryption_key.key_url = AAZStrArg( + options=["key-url"], + help="The key URL, unversioned. For example: https://contosovault.vault.azure.net/keys/azureKey.", + nullable=True, + ) + + mobile_network = cls._args_schema.mobile_network + mobile_network.id = AAZStrArg( + options=["id"], + help="Mobile network resource ID.", + fmt=AAZStrArgFormat( + pattern="^/[sS][uU][bB][sS][cC][rR][iI][pP][tT][iI][oO][nN][sS]/[^/?#]+/[rR][eE][sS][oO][uU][rR][cC][eE][gG][rR][oO][uU][pP][sS]/[^/?#]+/[pP][rR][oO][vV][iI][dD][eE][rR][sS]/[mM][iI][cC][rR][oO][sS][oO][fF][tT]\.[mM][oO][bB][iI][lL][eE][nN][eE][tT][wW][oO][rR][kK]/[mM][oO][bB][iI][lL][eE][nN][eE][tT][wW][oO][rR][kK][sS]/[^/?#]+$", + ), + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.SimGroupsGet(ctx=self.ctx)() + self.pre_instance_update(self.ctx.vars.instance) + self.InstanceUpdateByJson(ctx=self.ctx)() + self.InstanceUpdateByGeneric(ctx=self.ctx)() + self.post_instance_update(self.ctx.vars.instance) + yield self.SimGroupsCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + @register_callback + def pre_instance_update(self, instance): + pass + + @register_callback + def post_instance_update(self, instance): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class SimGroupsGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/simGroups/{simGroupName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "simGroupName", self.ctx.args.sim_group_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + _UpdateHelper._build_schema_sim_group_read(cls._schema_on_200) + + return cls._schema_on_200 + + class SimGroupsCreateOrUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200, 201]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/simGroups/{simGroupName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "simGroupName", self.ctx.args.sim_group_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + value=self.ctx.vars.instance, + ) + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + _UpdateHelper._build_schema_sim_group_read(cls._schema_on_200_201) + + return cls._schema_on_200_201 + + class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): + + def __call__(self, *args, **kwargs): + self._update_instance(self.ctx.vars.instance) + + def _update_instance(self, instance): + _instance_value, _builder = self.new_content_builder( + self.ctx.args, + value=instance, + typ=AAZObjectType + ) + _builder.set_prop("identity", AAZObjectType, ".identity") + _builder.set_prop("properties", AAZObjectType, ".", typ_kwargs={"flags": {"required": True, "client_flatten": True}}) + _builder.set_prop("tags", AAZDictType, ".tags") + + identity = _builder.get(".identity") + if identity is not None: + identity.set_prop("type", AAZStrType, ".type", typ_kwargs={"flags": {"required": True}}) + identity.set_prop("userAssignedIdentities", AAZDictType, ".user_assigned_identities") + + user_assigned_identities = _builder.get(".identity.userAssignedIdentities") + if user_assigned_identities is not None: + user_assigned_identities.set_elements(AAZObjectType, ".") + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("encryptionKey", AAZObjectType, ".encryption_key") + properties.set_prop("mobileNetwork", AAZObjectType, ".mobile_network") + + encryption_key = _builder.get(".properties.encryptionKey") + if encryption_key is not None: + encryption_key.set_prop("keyUrl", AAZStrType, ".key_url") + + mobile_network = _builder.get(".properties.mobileNetwork") + if mobile_network is not None: + mobile_network.set_prop("id", AAZStrType, ".id", typ_kwargs={"flags": {"required": True}}) + + tags = _builder.get(".tags") + if tags is not None: + tags.set_elements(AAZStrType, ".") + + return _instance_value + + class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): + + def __call__(self, *args, **kwargs): + self._update_instance_by_generic( + self.ctx.vars.instance, + self.ctx.generic_update_args + ) + + +class _UpdateHelper: + """Helper class for Update""" + + _schema_sim_group_read = None + + @classmethod + def _build_schema_sim_group_read(cls, _schema): + if cls._schema_sim_group_read is not None: + _schema.id = cls._schema_sim_group_read.id + _schema.identity = cls._schema_sim_group_read.identity + _schema.location = cls._schema_sim_group_read.location + _schema.name = cls._schema_sim_group_read.name + _schema.properties = cls._schema_sim_group_read.properties + _schema.system_data = cls._schema_sim_group_read.system_data + _schema.tags = cls._schema_sim_group_read.tags + _schema.type = cls._schema_sim_group_read.type + return + + cls._schema_sim_group_read = _schema_sim_group_read = AAZObjectType() + + sim_group_read = _schema_sim_group_read + sim_group_read.id = AAZStrType( + flags={"read_only": True}, + ) + sim_group_read.identity = AAZObjectType() + sim_group_read.location = AAZStrType( + flags={"required": True}, + ) + sim_group_read.name = AAZStrType( + flags={"read_only": True}, + ) + sim_group_read.properties = AAZObjectType( + flags={"required": True, "client_flatten": True}, + ) + sim_group_read.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + sim_group_read.tags = AAZDictType() + sim_group_read.type = AAZStrType( + flags={"read_only": True}, + ) + + identity = _schema_sim_group_read.identity + identity.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + identity.tenant_id = AAZStrType( + serialized_name="tenantId", + flags={"read_only": True}, + ) + identity.type = AAZStrType( + flags={"required": True}, + ) + identity.user_assigned_identities = AAZDictType( + serialized_name="userAssignedIdentities", + ) + + user_assigned_identities = _schema_sim_group_read.identity.user_assigned_identities + user_assigned_identities.Element = AAZObjectType() + + _element = _schema_sim_group_read.identity.user_assigned_identities.Element + _element.client_id = AAZStrType( + serialized_name="clientId", + flags={"read_only": True}, + ) + _element.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + + properties = _schema_sim_group_read.properties + properties.encryption_key = AAZObjectType( + serialized_name="encryptionKey", + ) + properties.mobile_network = AAZObjectType( + serialized_name="mobileNetwork", + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + encryption_key = _schema_sim_group_read.properties.encryption_key + encryption_key.key_url = AAZStrType( + serialized_name="keyUrl", + ) + + mobile_network = _schema_sim_group_read.properties.mobile_network + mobile_network.id = AAZStrType( + flags={"required": True}, + ) + + system_data = _schema_sim_group_read.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = _schema_sim_group_read.tags + tags.Element = AAZStrType() + + _schema.id = cls._schema_sim_group_read.id + _schema.identity = cls._schema_sim_group_read.identity + _schema.location = cls._schema_sim_group_read.location + _schema.name = cls._schema_sim_group_read.name + _schema.properties = cls._schema_sim_group_read.properties + _schema.system_data = cls._schema_sim_group_read.system_data + _schema.tags = cls._schema_sim_group_read.tags + _schema.type = cls._schema_sim_group_read.type + + +__all__ = ["Update"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/group/_wait.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/group/_wait.py new file mode 100644 index 00000000000..70cd87b3412 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/group/_wait.py @@ -0,0 +1,259 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network sim group wait", +) +class Wait(AAZWaitCommand): + """Place the CLI in a waiting state until a condition is met. + """ + + _aaz_info = { + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/simgroups/{}", "2022-11-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.sim_group_name = AAZStrArg( + options=["-n", "--name", "--sim-group-name"], + help="The name of the SIM Group.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.SimGroupsGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) + return result + + class SimGroupsGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/simGroups/{simGroupName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "simGroupName", self.ctx.args.sim_group_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.identity = AAZObjectType() + _schema_on_200.location = AAZStrType( + flags={"required": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType( + flags={"required": True, "client_flatten": True}, + ) + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + identity = cls._schema_on_200.identity + identity.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + identity.tenant_id = AAZStrType( + serialized_name="tenantId", + flags={"read_only": True}, + ) + identity.type = AAZStrType( + flags={"required": True}, + ) + identity.user_assigned_identities = AAZDictType( + serialized_name="userAssignedIdentities", + ) + + user_assigned_identities = cls._schema_on_200.identity.user_assigned_identities + user_assigned_identities.Element = AAZObjectType() + + _element = cls._schema_on_200.identity.user_assigned_identities.Element + _element.client_id = AAZStrType( + serialized_name="clientId", + flags={"read_only": True}, + ) + _element.principal_id = AAZStrType( + serialized_name="principalId", + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.encryption_key = AAZObjectType( + serialized_name="encryptionKey", + ) + properties.mobile_network = AAZObjectType( + serialized_name="mobileNetwork", + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + encryption_key = cls._schema_on_200.properties.encryption_key + encryption_key.key_url = AAZStrType( + serialized_name="keyUrl", + ) + + mobile_network = cls._schema_on_200.properties.mobile_network + mobile_network.id = AAZStrType( + flags={"required": True}, + ) + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _WaitHelper: + """Helper class for Wait""" + + +__all__ = ["Wait"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/policy/__cmd_group.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/policy/__cmd_group.py new file mode 100644 index 00000000000..cd596a05f1f --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/policy/__cmd_group.py @@ -0,0 +1,23 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command_group( + "mobile-network sim policy", +) +class __CMDGroup(AAZCommandGroup): + """Manage sim policy + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/policy/__init__.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/policy/__init__.py new file mode 100644 index 00000000000..db73033039b --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/policy/__init__.py @@ -0,0 +1,17 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * +from ._create import * +from ._delete import * +from ._list import * +from ._show import * +from ._update import * +from ._wait import * diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/policy/_create.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/policy/_create.py new file mode 100644 index 00000000000..3b69f5fe9a6 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/policy/_create.py @@ -0,0 +1,741 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network sim policy create", +) +class Create(AAZCommand): + """Create a SIM policy. + + :example: Create sim policy + az mobile-network sim policy create -g rg -n sim-policy-name --mobile-network-name mobile-network-name --default-slice '{id:slice-id}' --slice-config "[{slice:{id:slice-id},defaultDataNetwork:{id:data-network-id},dataNetworkConfigurations:[{dataNetwork:{id:data-network-id},allowedServices:[{id:service-id}],sessionAmbr:{uplink:'500 Mbps',downlink:'1 Gbps'}}]}]" --ue-ambr "{uplink:'500 Mbps',downlink:'1 Gbps'}" + """ + + _aaz_info = { + "version": "2022-11-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/mobilenetworks/{}/simpolicies/{}", "2022-11-01"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.mobile_network_name = AAZStrArg( + options=["--mobile-network-name"], + help="The name of the mobile network.", + required=True, + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.sim_policy_name = AAZStrArg( + options=["-n", "--name", "--sim-policy-name"], + help="The name of the SIM policy.", + required=True, + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + + # define Arg Group "Parameters" + + _args_schema = cls._args_schema + _args_schema.location = AAZResourceLocationArg( + arg_group="Parameters", + help="The geo-location where the resource lives", + required=True, + fmt=AAZResourceLocationArgFormat( + resource_group_arg="resource_group", + ), + ) + _args_schema.tags = AAZDictArg( + options=["--tags"], + arg_group="Parameters", + help="Resource tags.", + ) + + tags = cls._args_schema.tags + tags.Element = AAZStrArg() + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.default_slice = AAZObjectArg( + options=["--default-slice"], + arg_group="Properties", + help="The default slice to use if the UE does not explicitly specify it. This slice must exist in the `sliceConfigurations` map.", + required=True, + ) + cls._build_args_slice_resource_id_create(_args_schema.default_slice) + _args_schema.registration_timer = AAZIntArg( + options=["--registration-timer"], + arg_group="Properties", + help="Interval for the UE periodic registration update procedure, in seconds.", + default=3240, + fmt=AAZIntArgFormat( + minimum=30, + ), + ) + _args_schema.rfsp_index = AAZIntArg( + options=["--rfsp-index"], + arg_group="Properties", + help="RAT/Frequency Selection Priority Index, defined in 3GPP TS 36.413. This is an optional setting and by default is unspecified.", + fmt=AAZIntArgFormat( + maximum=256, + minimum=1, + ), + ) + _args_schema.slice_config = AAZListArg( + options=["--slice-config"], + arg_group="Properties", + help="The allowed slices and the settings to use for them. The list must not contain duplicate items and must contain at least one item.", + required=True, + fmt=AAZListArgFormat( + unique=True, + ), + ) + _args_schema.ue_ambr = AAZObjectArg( + options=["--ue-ambr"], + arg_group="Properties", + help="Aggregate maximum bit rate across all non-GBR QoS flows of all PDU sessions of a given UE. See 3GPP TS23.501 section 5.7.2.6 for a full description of the UE-AMBR.", + required=True, + ) + cls._build_args_ambr_create(_args_schema.ue_ambr) + + slice_config = cls._args_schema.slice_config + slice_config.Element = AAZObjectArg() + + _element = cls._args_schema.slice_config.Element + _element.data_network_configurations = AAZListArg( + options=["data-network-configurations"], + help="The allowed data networks and the settings to use for them. The list must not contain duplicate items and must contain at least one item.", + required=True, + fmt=AAZListArgFormat( + unique=True, + ), + ) + _element.default_data_network = AAZObjectArg( + options=["default-data-network"], + help="The default data network to use if the UE does not explicitly specify it. Configuration for this object must exist in the `dataNetworkConfigurations` map.", + required=True, + ) + cls._build_args_data_network_resource_id_create(_element.default_data_network) + _element.slice = AAZObjectArg( + options=["slice"], + help="A reference to the slice that these settings apply to", + required=True, + ) + cls._build_args_slice_resource_id_create(_element.slice) + + data_network_configurations = cls._args_schema.slice_config.Element.data_network_configurations + data_network_configurations.Element = AAZObjectArg() + + _element = cls._args_schema.slice_config.Element.data_network_configurations.Element + _element.five_qi = AAZIntArg( + options=["five-qi"], + help="Default QoS Flow 5G QoS Indicator value. The 5QI identifies a specific QoS forwarding treatment to be provided to a flow. This must not be a standardized 5QI value corresponding to a GBR (guaranteed bit rate) QoS Flow. The illegal GBR 5QI values are: 1, 2, 3, 4, 65, 66, 67, 71, 72, 73, 74, 75, 76, 82, 83, 84, and 85. See 3GPP TS23.501 section 5.7.2.1 for a full description of the 5QI parameter, and table 5.7.4-1 for the definition of which are the GBR 5QI values.", + default=9, + fmt=AAZIntArgFormat( + maximum=255, + minimum=0, + ), + ) + _element.additional_session_type = AAZListArg( + options=["additional-session-type"], + help="Allowed session types in addition to the default session type. Must not duplicate the default session type.", + ) + _element.arp_level = AAZIntArg( + options=["arp-level"], + help="Default QoS Flow allocation and retention priority (ARP) level. Flows with higher priority preempt flows with lower priority, if the settings of `preemptionCapability` and `preemptionVulnerability` allow it. 1 is the highest level of priority. If this field is not specified then `5qi` is used to derive the ARP value. See 3GPP TS23.501 section 5.7.2.2 for a full description of the ARP parameters.", + default=9, + fmt=AAZIntArgFormat( + maximum=15, + minimum=1, + ), + ) + _element.allowed_services = AAZListArg( + options=["allowed-services"], + help="List of services that can be used as part of this SIM policy. The list must not contain duplicate items and must contain at least one item.", + required=True, + fmt=AAZListArgFormat( + unique=True, + ), + ) + _element.data_network = AAZObjectArg( + options=["data-network"], + help="A reference to the data network that these settings apply to", + required=True, + ) + cls._build_args_data_network_resource_id_create(_element.data_network) + _element.default_session_type = AAZStrArg( + options=["default-session-type"], + help="The default PDU session type, which is used if the UE does not request a specific session type.", + default="IPv4", + enum={"IPv4": "IPv4", "IPv6": "IPv6"}, + ) + _element.maximum_number_of_buffered_packets = AAZIntArg( + options=["maximum-number-of-buffered-packets"], + help="The maximum number of downlink packets to buffer at the user plane for High Latency Communication - Extended Buffering. See 3GPP TS29.272 v15.10.0 section 7.3.188 for a full description. This maximum is not guaranteed because there is a internal limit on buffered packets across all PDU sessions.", + default=10, + fmt=AAZIntArgFormat( + minimum=0, + ), + ) + _element.preemption_capability = AAZStrArg( + options=["preemption-capability"], + help="Default QoS Flow preemption capability. The preemption capability of a QoS Flow controls whether it can preempt another QoS Flow with a lower priority level. See 3GPP TS23.501 section 5.7.2.2 for a full description of the ARP parameters.", + default="NotPreempt", + enum={"MayPreempt": "MayPreempt", "NotPreempt": "NotPreempt"}, + ) + _element.preemption_vulnerability = AAZStrArg( + options=["preemption-vulnerability"], + help="Default QoS Flow preemption vulnerability. The preemption vulnerability of a QoS Flow controls whether it can be preempted by a QoS Flow with a higher priority level. See 3GPP TS23.501 section 5.7.2.2 for a full description of the ARP parameters.", + default="Preemptable", + enum={"NotPreemptable": "NotPreemptable", "Preemptable": "Preemptable"}, + ) + _element.session_ambr = AAZObjectArg( + options=["session-ambr"], + help="Aggregate maximum bit rate across all non-GBR QoS flows of a given PDU session. See 3GPP TS23.501 section 5.7.2.6 for a full description of the Session-AMBR.", + required=True, + ) + cls._build_args_ambr_create(_element.session_ambr) + + additional_session_type = cls._args_schema.slice_config.Element.data_network_configurations.Element.additional_session_type + additional_session_type.Element = AAZStrArg( + enum={"IPv4": "IPv4", "IPv6": "IPv6"}, + ) + + allowed_services = cls._args_schema.slice_config.Element.data_network_configurations.Element.allowed_services + allowed_services.Element = AAZObjectArg() + + _element = cls._args_schema.slice_config.Element.data_network_configurations.Element.allowed_services.Element + _element.id = AAZStrArg( + options=["id"], + help="Service resource ID.", + required=True, + fmt=AAZStrArgFormat( + pattern="^/[sS][uU][bB][sS][cC][rR][iI][pP][tT][iI][oO][nN][sS]/[^/?#]+/[rR][eE][sS][oO][uU][rR][cC][eE][gG][rR][oO][uU][pP][sS]/[^/?#]+/[pP][rR][oO][vV][iI][dD][eE][rR][sS]/[mM][iI][cC][rR][oO][sS][oO][fF][tT]\.[mM][oO][bB][iI][lL][eE][nN][eE][tT][wW][oO][rR][kK]/[mM][oO][bB][iI][lL][eE][nN][eE][tT][wW][oO][rR][kK][sS]/[^/?#]+/[sS][eE][rR][vV][iI][cC][eE][sS]/[^/?#]+$", + ), + ) + return cls._args_schema + + _args_ambr_create = None + + @classmethod + def _build_args_ambr_create(cls, _schema): + if cls._args_ambr_create is not None: + _schema.downlink = cls._args_ambr_create.downlink + _schema.uplink = cls._args_ambr_create.uplink + return + + cls._args_ambr_create = AAZObjectArg() + + ambr_create = cls._args_ambr_create + ambr_create.downlink = AAZStrArg( + options=["downlink"], + help="Downlink bit rate.", + required=True, + fmt=AAZStrArgFormat( + pattern="^\d+(\.\d+)? (bps|Kbps|Mbps|Gbps|Tbps)$", + ), + ) + ambr_create.uplink = AAZStrArg( + options=["uplink"], + help="Uplink bit rate.", + required=True, + fmt=AAZStrArgFormat( + pattern="^\d+(\.\d+)? (bps|Kbps|Mbps|Gbps|Tbps)$", + ), + ) + + _schema.downlink = cls._args_ambr_create.downlink + _schema.uplink = cls._args_ambr_create.uplink + + _args_data_network_resource_id_create = None + + @classmethod + def _build_args_data_network_resource_id_create(cls, _schema): + if cls._args_data_network_resource_id_create is not None: + _schema.id = cls._args_data_network_resource_id_create.id + return + + cls._args_data_network_resource_id_create = AAZObjectArg() + + data_network_resource_id_create = cls._args_data_network_resource_id_create + data_network_resource_id_create.id = AAZStrArg( + options=["id"], + help="Data network resource ID.", + required=True, + fmt=AAZStrArgFormat( + pattern="^/[sS][uU][bB][sS][cC][rR][iI][pP][tT][iI][oO][nN][sS]/[^/?#]+/[rR][eE][sS][oO][uU][rR][cC][eE][gG][rR][oO][uU][pP][sS]/[^/?#]+/[pP][rR][oO][vV][iI][dD][eE][rR][sS]/[mM][iI][cC][rR][oO][sS][oO][fF][tT]\.[mM][oO][bB][iI][lL][eE][nN][eE][tT][wW][oO][rR][kK]/[mM][oO][bB][iI][lL][eE][nN][eE][tT][wW][oO][rR][kK][sS]/[^/?#]+/[dD][aA][tT][aA][nN][eE][tT][wW][oO][rR][kK][sS]/[^/?#]+$", + ), + ) + + _schema.id = cls._args_data_network_resource_id_create.id + + _args_slice_resource_id_create = None + + @classmethod + def _build_args_slice_resource_id_create(cls, _schema): + if cls._args_slice_resource_id_create is not None: + _schema.id = cls._args_slice_resource_id_create.id + return + + cls._args_slice_resource_id_create = AAZObjectArg() + + slice_resource_id_create = cls._args_slice_resource_id_create + slice_resource_id_create.id = AAZStrArg( + options=["id"], + help="Slice resource ID.", + required=True, + fmt=AAZStrArgFormat( + pattern="^/[sS][uU][bB][sS][cC][rR][iI][pP][tT][iI][oO][nN][sS]/[^/?#]+/[rR][eE][sS][oO][uU][rR][cC][eE][gG][rR][oO][uU][pP][sS]/[^/?#]+/[pP][rR][oO][vV][iI][dD][eE][rR][sS]/[mM][iI][cC][rR][oO][sS][oO][fF][tT]\.[mM][oO][bB][iI][lL][eE][nN][eE][tT][wW][oO][rR][kK]/[mM][oO][bB][iI][lL][eE][nN][eE][tT][wW][oO][rR][kK][sS]/[^/?#]+/[sS][lL][iI][cC][eE][sS]/[^/?#]+$", + ), + ) + + _schema.id = cls._args_slice_resource_id_create.id + + def _execute_operations(self): + self.pre_operations() + yield self.SimPoliciesCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class SimPoliciesCreateOrUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200, 201]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/mobileNetworks/{mobileNetworkName}/simPolicies/{simPolicyName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "mobileNetworkName", self.ctx.args.mobile_network_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "simPolicyName", self.ctx.args.sim_policy_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + typ=AAZObjectType, + typ_kwargs={"flags": {"required": True, "client_flatten": True}} + ) + _builder.set_prop("location", AAZStrType, ".location", typ_kwargs={"flags": {"required": True}}) + _builder.set_prop("properties", AAZObjectType, ".", typ_kwargs={"flags": {"required": True, "client_flatten": True}}) + _builder.set_prop("tags", AAZDictType, ".tags") + + properties = _builder.get(".properties") + if properties is not None: + _CreateHelper._build_schema_slice_resource_id_create(properties.set_prop("defaultSlice", AAZObjectType, ".default_slice", typ_kwargs={"flags": {"required": True}})) + properties.set_prop("registrationTimer", AAZIntType, ".registration_timer") + properties.set_prop("rfspIndex", AAZIntType, ".rfsp_index") + properties.set_prop("sliceConfigurations", AAZListType, ".slice_config", typ_kwargs={"flags": {"required": True}}) + _CreateHelper._build_schema_ambr_create(properties.set_prop("ueAmbr", AAZObjectType, ".ue_ambr", typ_kwargs={"flags": {"required": True}})) + + slice_configurations = _builder.get(".properties.sliceConfigurations") + if slice_configurations is not None: + slice_configurations.set_elements(AAZObjectType, ".") + + _elements = _builder.get(".properties.sliceConfigurations[]") + if _elements is not None: + _elements.set_prop("dataNetworkConfigurations", AAZListType, ".data_network_configurations", typ_kwargs={"flags": {"required": True}}) + _CreateHelper._build_schema_data_network_resource_id_create(_elements.set_prop("defaultDataNetwork", AAZObjectType, ".default_data_network", typ_kwargs={"flags": {"required": True}})) + _CreateHelper._build_schema_slice_resource_id_create(_elements.set_prop("slice", AAZObjectType, ".slice", typ_kwargs={"flags": {"required": True}})) + + data_network_configurations = _builder.get(".properties.sliceConfigurations[].dataNetworkConfigurations") + if data_network_configurations is not None: + data_network_configurations.set_elements(AAZObjectType, ".") + + _elements = _builder.get(".properties.sliceConfigurations[].dataNetworkConfigurations[]") + if _elements is not None: + _elements.set_prop("5qi", AAZIntType, ".five_qi") + _elements.set_prop("additionalAllowedSessionTypes", AAZListType, ".additional_session_type") + _elements.set_prop("allocationAndRetentionPriorityLevel", AAZIntType, ".arp_level") + _elements.set_prop("allowedServices", AAZListType, ".allowed_services", typ_kwargs={"flags": {"required": True}}) + _CreateHelper._build_schema_data_network_resource_id_create(_elements.set_prop("dataNetwork", AAZObjectType, ".data_network", typ_kwargs={"flags": {"required": True}})) + _elements.set_prop("defaultSessionType", AAZStrType, ".default_session_type") + _elements.set_prop("maximumNumberOfBufferedPackets", AAZIntType, ".maximum_number_of_buffered_packets") + _elements.set_prop("preemptionCapability", AAZStrType, ".preemption_capability") + _elements.set_prop("preemptionVulnerability", AAZStrType, ".preemption_vulnerability") + _CreateHelper._build_schema_ambr_create(_elements.set_prop("sessionAmbr", AAZObjectType, ".session_ambr", typ_kwargs={"flags": {"required": True}})) + + additional_allowed_session_types = _builder.get(".properties.sliceConfigurations[].dataNetworkConfigurations[].additionalAllowedSessionTypes") + if additional_allowed_session_types is not None: + additional_allowed_session_types.set_elements(AAZStrType, ".") + + allowed_services = _builder.get(".properties.sliceConfigurations[].dataNetworkConfigurations[].allowedServices") + if allowed_services is not None: + allowed_services.set_elements(AAZObjectType, ".") + + _elements = _builder.get(".properties.sliceConfigurations[].dataNetworkConfigurations[].allowedServices[]") + if _elements is not None: + _elements.set_prop("id", AAZStrType, ".id", typ_kwargs={"flags": {"required": True}}) + + tags = _builder.get(".tags") + if tags is not None: + tags.set_elements(AAZStrType, ".") + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + + _schema_on_200_201 = cls._schema_on_200_201 + _schema_on_200_201.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.location = AAZStrType( + flags={"required": True}, + ) + _schema_on_200_201.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.properties = AAZObjectType( + flags={"required": True, "client_flatten": True}, + ) + _schema_on_200_201.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200_201.tags = AAZDictType() + _schema_on_200_201.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200_201.properties + properties.default_slice = AAZObjectType( + serialized_name="defaultSlice", + flags={"required": True}, + ) + _CreateHelper._build_schema_slice_resource_id_read(properties.default_slice) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.registration_timer = AAZIntType( + serialized_name="registrationTimer", + ) + properties.rfsp_index = AAZIntType( + serialized_name="rfspIndex", + ) + properties.site_provisioning_state = AAZDictType( + serialized_name="siteProvisioningState", + flags={"read_only": True}, + ) + properties.slice_configurations = AAZListType( + serialized_name="sliceConfigurations", + flags={"required": True}, + ) + properties.ue_ambr = AAZObjectType( + serialized_name="ueAmbr", + flags={"required": True}, + ) + _CreateHelper._build_schema_ambr_read(properties.ue_ambr) + + site_provisioning_state = cls._schema_on_200_201.properties.site_provisioning_state + site_provisioning_state.Element = AAZStrType( + flags={"read_only": True}, + ) + + slice_configurations = cls._schema_on_200_201.properties.slice_configurations + slice_configurations.Element = AAZObjectType() + + _element = cls._schema_on_200_201.properties.slice_configurations.Element + _element.data_network_configurations = AAZListType( + serialized_name="dataNetworkConfigurations", + flags={"required": True}, + ) + _element.default_data_network = AAZObjectType( + serialized_name="defaultDataNetwork", + flags={"required": True}, + ) + _CreateHelper._build_schema_data_network_resource_id_read(_element.default_data_network) + _element.slice = AAZObjectType( + flags={"required": True}, + ) + _CreateHelper._build_schema_slice_resource_id_read(_element.slice) + + data_network_configurations = cls._schema_on_200_201.properties.slice_configurations.Element.data_network_configurations + data_network_configurations.Element = AAZObjectType() + + _element = cls._schema_on_200_201.properties.slice_configurations.Element.data_network_configurations.Element + _element["5qi"] = AAZIntType() + _element.additional_allowed_session_types = AAZListType( + serialized_name="additionalAllowedSessionTypes", + ) + _element.allocation_and_retention_priority_level = AAZIntType( + serialized_name="allocationAndRetentionPriorityLevel", + ) + _element.allowed_services = AAZListType( + serialized_name="allowedServices", + flags={"required": True}, + ) + _element.data_network = AAZObjectType( + serialized_name="dataNetwork", + flags={"required": True}, + ) + _CreateHelper._build_schema_data_network_resource_id_read(_element.data_network) + _element.default_session_type = AAZStrType( + serialized_name="defaultSessionType", + ) + _element.maximum_number_of_buffered_packets = AAZIntType( + serialized_name="maximumNumberOfBufferedPackets", + ) + _element.preemption_capability = AAZStrType( + serialized_name="preemptionCapability", + ) + _element.preemption_vulnerability = AAZStrType( + serialized_name="preemptionVulnerability", + ) + _element.session_ambr = AAZObjectType( + serialized_name="sessionAmbr", + flags={"required": True}, + ) + _CreateHelper._build_schema_ambr_read(_element.session_ambr) + + additional_allowed_session_types = cls._schema_on_200_201.properties.slice_configurations.Element.data_network_configurations.Element.additional_allowed_session_types + additional_allowed_session_types.Element = AAZStrType() + + allowed_services = cls._schema_on_200_201.properties.slice_configurations.Element.data_network_configurations.Element.allowed_services + allowed_services.Element = AAZObjectType() + + _element = cls._schema_on_200_201.properties.slice_configurations.Element.data_network_configurations.Element.allowed_services.Element + _element.id = AAZStrType( + flags={"required": True}, + ) + + system_data = cls._schema_on_200_201.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200_201.tags + tags.Element = AAZStrType() + + return cls._schema_on_200_201 + + +class _CreateHelper: + """Helper class for Create""" + + @classmethod + def _build_schema_ambr_create(cls, _builder): + if _builder is None: + return + _builder.set_prop("downlink", AAZStrType, ".downlink", typ_kwargs={"flags": {"required": True}}) + _builder.set_prop("uplink", AAZStrType, ".uplink", typ_kwargs={"flags": {"required": True}}) + + @classmethod + def _build_schema_data_network_resource_id_create(cls, _builder): + if _builder is None: + return + _builder.set_prop("id", AAZStrType, ".id", typ_kwargs={"flags": {"required": True}}) + + @classmethod + def _build_schema_slice_resource_id_create(cls, _builder): + if _builder is None: + return + _builder.set_prop("id", AAZStrType, ".id", typ_kwargs={"flags": {"required": True}}) + + _schema_ambr_read = None + + @classmethod + def _build_schema_ambr_read(cls, _schema): + if cls._schema_ambr_read is not None: + _schema.downlink = cls._schema_ambr_read.downlink + _schema.uplink = cls._schema_ambr_read.uplink + return + + cls._schema_ambr_read = _schema_ambr_read = AAZObjectType() + + ambr_read = _schema_ambr_read + ambr_read.downlink = AAZStrType( + flags={"required": True}, + ) + ambr_read.uplink = AAZStrType( + flags={"required": True}, + ) + + _schema.downlink = cls._schema_ambr_read.downlink + _schema.uplink = cls._schema_ambr_read.uplink + + _schema_data_network_resource_id_read = None + + @classmethod + def _build_schema_data_network_resource_id_read(cls, _schema): + if cls._schema_data_network_resource_id_read is not None: + _schema.id = cls._schema_data_network_resource_id_read.id + return + + cls._schema_data_network_resource_id_read = _schema_data_network_resource_id_read = AAZObjectType() + + data_network_resource_id_read = _schema_data_network_resource_id_read + data_network_resource_id_read.id = AAZStrType( + flags={"required": True}, + ) + + _schema.id = cls._schema_data_network_resource_id_read.id + + _schema_slice_resource_id_read = None + + @classmethod + def _build_schema_slice_resource_id_read(cls, _schema): + if cls._schema_slice_resource_id_read is not None: + _schema.id = cls._schema_slice_resource_id_read.id + return + + cls._schema_slice_resource_id_read = _schema_slice_resource_id_read = AAZObjectType() + + slice_resource_id_read = _schema_slice_resource_id_read + slice_resource_id_read.id = AAZStrType( + flags={"required": True}, + ) + + _schema.id = cls._schema_slice_resource_id_read.id + + +__all__ = ["Create"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/policy/_delete.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/policy/_delete.py new file mode 100644 index 00000000000..ecf7e319489 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/policy/_delete.py @@ -0,0 +1,181 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network sim policy delete", + confirmation="Are you sure you want to perform this operation?", +) +class Delete(AAZCommand): + """Delete the specified SIM policy. + + :example: Delete sim policy + az mobile-network sim policy delete -g rg -n sim-policy-name --mobile-network-name mobile-network-name + """ + + _aaz_info = { + "version": "2022-11-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/mobilenetworks/{}/simpolicies/{}", "2022-11-01"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, None) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.mobile_network_name = AAZStrArg( + options=["--mobile-network-name"], + help="The name of the mobile network.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.sim_policy_name = AAZStrArg( + options=["-n", "--name", "--sim-policy-name"], + help="The name of the SIM policy.", + required=True, + id_part="child_name_1", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + yield self.SimPoliciesDelete(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + class SimPoliciesDelete(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [204]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_204, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/mobileNetworks/{mobileNetworkName}/simPolicies/{simPolicyName}", + **self.url_parameters + ) + + @property + def method(self): + return "DELETE" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "mobileNetworkName", self.ctx.args.mobile_network_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "simPolicyName", self.ctx.args.sim_policy_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + def on_200(self, session): + pass + + def on_204(self, session): + pass + + +class _DeleteHelper: + """Helper class for Delete""" + + +__all__ = ["Delete"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/policy/_list.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/policy/_list.py new file mode 100644 index 00000000000..f3fe4eede85 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/policy/_list.py @@ -0,0 +1,378 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network sim policy list", +) +class List(AAZCommand): + """List all the SIM policies in a mobile network. + + :example: List sim policy by resource group + az mobile-network sim policy list -g rg --mobile-network-name mobile-network-name + """ + + _aaz_info = { + "version": "2022-11-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/mobilenetworks/{}/simpolicies", "2022-11-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_paging(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.mobile_network_name = AAZStrArg( + options=["--mobile-network-name"], + help="The name of the mobile network.", + required=True, + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.SimPoliciesListByMobileNetwork(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) + next_link = self.deserialize_output(self.ctx.vars.instance.next_link) + return result, next_link + + class SimPoliciesListByMobileNetwork(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/mobileNetworks/{mobileNetworkName}/simPolicies", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "mobileNetworkName", self.ctx.args.mobile_network_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.next_link = AAZStrType( + serialized_name="nextLink", + flags={"read_only": True}, + ) + _schema_on_200.value = AAZListType() + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.location = AAZStrType( + flags={"required": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType( + flags={"required": True, "client_flatten": True}, + ) + _element.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _element.tags = AAZDictType() + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.default_slice = AAZObjectType( + serialized_name="defaultSlice", + flags={"required": True}, + ) + _ListHelper._build_schema_slice_resource_id_read(properties.default_slice) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.registration_timer = AAZIntType( + serialized_name="registrationTimer", + ) + properties.rfsp_index = AAZIntType( + serialized_name="rfspIndex", + ) + properties.site_provisioning_state = AAZDictType( + serialized_name="siteProvisioningState", + flags={"read_only": True}, + ) + properties.slice_configurations = AAZListType( + serialized_name="sliceConfigurations", + flags={"required": True}, + ) + properties.ue_ambr = AAZObjectType( + serialized_name="ueAmbr", + flags={"required": True}, + ) + _ListHelper._build_schema_ambr_read(properties.ue_ambr) + + site_provisioning_state = cls._schema_on_200.value.Element.properties.site_provisioning_state + site_provisioning_state.Element = AAZStrType( + flags={"read_only": True}, + ) + + slice_configurations = cls._schema_on_200.value.Element.properties.slice_configurations + slice_configurations.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element.properties.slice_configurations.Element + _element.data_network_configurations = AAZListType( + serialized_name="dataNetworkConfigurations", + flags={"required": True}, + ) + _element.default_data_network = AAZObjectType( + serialized_name="defaultDataNetwork", + flags={"required": True}, + ) + _ListHelper._build_schema_data_network_resource_id_read(_element.default_data_network) + _element.slice = AAZObjectType( + flags={"required": True}, + ) + _ListHelper._build_schema_slice_resource_id_read(_element.slice) + + data_network_configurations = cls._schema_on_200.value.Element.properties.slice_configurations.Element.data_network_configurations + data_network_configurations.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element.properties.slice_configurations.Element.data_network_configurations.Element + _element["5qi"] = AAZIntType() + _element.additional_allowed_session_types = AAZListType( + serialized_name="additionalAllowedSessionTypes", + ) + _element.allocation_and_retention_priority_level = AAZIntType( + serialized_name="allocationAndRetentionPriorityLevel", + ) + _element.allowed_services = AAZListType( + serialized_name="allowedServices", + flags={"required": True}, + ) + _element.data_network = AAZObjectType( + serialized_name="dataNetwork", + flags={"required": True}, + ) + _ListHelper._build_schema_data_network_resource_id_read(_element.data_network) + _element.default_session_type = AAZStrType( + serialized_name="defaultSessionType", + ) + _element.maximum_number_of_buffered_packets = AAZIntType( + serialized_name="maximumNumberOfBufferedPackets", + ) + _element.preemption_capability = AAZStrType( + serialized_name="preemptionCapability", + ) + _element.preemption_vulnerability = AAZStrType( + serialized_name="preemptionVulnerability", + ) + _element.session_ambr = AAZObjectType( + serialized_name="sessionAmbr", + flags={"required": True}, + ) + _ListHelper._build_schema_ambr_read(_element.session_ambr) + + additional_allowed_session_types = cls._schema_on_200.value.Element.properties.slice_configurations.Element.data_network_configurations.Element.additional_allowed_session_types + additional_allowed_session_types.Element = AAZStrType() + + allowed_services = cls._schema_on_200.value.Element.properties.slice_configurations.Element.data_network_configurations.Element.allowed_services + allowed_services.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element.properties.slice_configurations.Element.data_network_configurations.Element.allowed_services.Element + _element.id = AAZStrType( + flags={"required": True}, + ) + + system_data = cls._schema_on_200.value.Element.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.value.Element.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _ListHelper: + """Helper class for List""" + + _schema_ambr_read = None + + @classmethod + def _build_schema_ambr_read(cls, _schema): + if cls._schema_ambr_read is not None: + _schema.downlink = cls._schema_ambr_read.downlink + _schema.uplink = cls._schema_ambr_read.uplink + return + + cls._schema_ambr_read = _schema_ambr_read = AAZObjectType() + + ambr_read = _schema_ambr_read + ambr_read.downlink = AAZStrType( + flags={"required": True}, + ) + ambr_read.uplink = AAZStrType( + flags={"required": True}, + ) + + _schema.downlink = cls._schema_ambr_read.downlink + _schema.uplink = cls._schema_ambr_read.uplink + + _schema_data_network_resource_id_read = None + + @classmethod + def _build_schema_data_network_resource_id_read(cls, _schema): + if cls._schema_data_network_resource_id_read is not None: + _schema.id = cls._schema_data_network_resource_id_read.id + return + + cls._schema_data_network_resource_id_read = _schema_data_network_resource_id_read = AAZObjectType() + + data_network_resource_id_read = _schema_data_network_resource_id_read + data_network_resource_id_read.id = AAZStrType( + flags={"required": True}, + ) + + _schema.id = cls._schema_data_network_resource_id_read.id + + _schema_slice_resource_id_read = None + + @classmethod + def _build_schema_slice_resource_id_read(cls, _schema): + if cls._schema_slice_resource_id_read is not None: + _schema.id = cls._schema_slice_resource_id_read.id + return + + cls._schema_slice_resource_id_read = _schema_slice_resource_id_read = AAZObjectType() + + slice_resource_id_read = _schema_slice_resource_id_read + slice_resource_id_read.id = AAZStrType( + flags={"required": True}, + ) + + _schema.id = cls._schema_slice_resource_id_read.id + + +__all__ = ["List"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/policy/_show.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/policy/_show.py new file mode 100644 index 00000000000..58f5c71fd0c --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/policy/_show.py @@ -0,0 +1,383 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network sim policy show", +) +class Show(AAZCommand): + """Get information about the specified SIM policy. + + :example: Show sim policy + az mobile-network sim policy show -g rg -n sim-policy-name --mobile-network-name mobile-network-name + """ + + _aaz_info = { + "version": "2022-11-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/mobilenetworks/{}/simpolicies/{}", "2022-11-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.mobile_network_name = AAZStrArg( + options=["--mobile-network-name"], + help="The name of the mobile network.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.sim_policy_name = AAZStrArg( + options=["-n", "--name", "--sim-policy-name"], + help="The name of the SIM policy.", + required=True, + id_part="child_name_1", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.SimPoliciesGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class SimPoliciesGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/mobileNetworks/{mobileNetworkName}/simPolicies/{simPolicyName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "mobileNetworkName", self.ctx.args.mobile_network_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "simPolicyName", self.ctx.args.sim_policy_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.location = AAZStrType( + flags={"required": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType( + flags={"required": True, "client_flatten": True}, + ) + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.default_slice = AAZObjectType( + serialized_name="defaultSlice", + flags={"required": True}, + ) + _ShowHelper._build_schema_slice_resource_id_read(properties.default_slice) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.registration_timer = AAZIntType( + serialized_name="registrationTimer", + ) + properties.rfsp_index = AAZIntType( + serialized_name="rfspIndex", + ) + properties.site_provisioning_state = AAZDictType( + serialized_name="siteProvisioningState", + flags={"read_only": True}, + ) + properties.slice_configurations = AAZListType( + serialized_name="sliceConfigurations", + flags={"required": True}, + ) + properties.ue_ambr = AAZObjectType( + serialized_name="ueAmbr", + flags={"required": True}, + ) + _ShowHelper._build_schema_ambr_read(properties.ue_ambr) + + site_provisioning_state = cls._schema_on_200.properties.site_provisioning_state + site_provisioning_state.Element = AAZStrType( + flags={"read_only": True}, + ) + + slice_configurations = cls._schema_on_200.properties.slice_configurations + slice_configurations.Element = AAZObjectType() + + _element = cls._schema_on_200.properties.slice_configurations.Element + _element.data_network_configurations = AAZListType( + serialized_name="dataNetworkConfigurations", + flags={"required": True}, + ) + _element.default_data_network = AAZObjectType( + serialized_name="defaultDataNetwork", + flags={"required": True}, + ) + _ShowHelper._build_schema_data_network_resource_id_read(_element.default_data_network) + _element.slice = AAZObjectType( + flags={"required": True}, + ) + _ShowHelper._build_schema_slice_resource_id_read(_element.slice) + + data_network_configurations = cls._schema_on_200.properties.slice_configurations.Element.data_network_configurations + data_network_configurations.Element = AAZObjectType() + + _element = cls._schema_on_200.properties.slice_configurations.Element.data_network_configurations.Element + _element["5qi"] = AAZIntType() + _element.additional_allowed_session_types = AAZListType( + serialized_name="additionalAllowedSessionTypes", + ) + _element.allocation_and_retention_priority_level = AAZIntType( + serialized_name="allocationAndRetentionPriorityLevel", + ) + _element.allowed_services = AAZListType( + serialized_name="allowedServices", + flags={"required": True}, + ) + _element.data_network = AAZObjectType( + serialized_name="dataNetwork", + flags={"required": True}, + ) + _ShowHelper._build_schema_data_network_resource_id_read(_element.data_network) + _element.default_session_type = AAZStrType( + serialized_name="defaultSessionType", + ) + _element.maximum_number_of_buffered_packets = AAZIntType( + serialized_name="maximumNumberOfBufferedPackets", + ) + _element.preemption_capability = AAZStrType( + serialized_name="preemptionCapability", + ) + _element.preemption_vulnerability = AAZStrType( + serialized_name="preemptionVulnerability", + ) + _element.session_ambr = AAZObjectType( + serialized_name="sessionAmbr", + flags={"required": True}, + ) + _ShowHelper._build_schema_ambr_read(_element.session_ambr) + + additional_allowed_session_types = cls._schema_on_200.properties.slice_configurations.Element.data_network_configurations.Element.additional_allowed_session_types + additional_allowed_session_types.Element = AAZStrType() + + allowed_services = cls._schema_on_200.properties.slice_configurations.Element.data_network_configurations.Element.allowed_services + allowed_services.Element = AAZObjectType() + + _element = cls._schema_on_200.properties.slice_configurations.Element.data_network_configurations.Element.allowed_services.Element + _element.id = AAZStrType( + flags={"required": True}, + ) + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _ShowHelper: + """Helper class for Show""" + + _schema_ambr_read = None + + @classmethod + def _build_schema_ambr_read(cls, _schema): + if cls._schema_ambr_read is not None: + _schema.downlink = cls._schema_ambr_read.downlink + _schema.uplink = cls._schema_ambr_read.uplink + return + + cls._schema_ambr_read = _schema_ambr_read = AAZObjectType() + + ambr_read = _schema_ambr_read + ambr_read.downlink = AAZStrType( + flags={"required": True}, + ) + ambr_read.uplink = AAZStrType( + flags={"required": True}, + ) + + _schema.downlink = cls._schema_ambr_read.downlink + _schema.uplink = cls._schema_ambr_read.uplink + + _schema_data_network_resource_id_read = None + + @classmethod + def _build_schema_data_network_resource_id_read(cls, _schema): + if cls._schema_data_network_resource_id_read is not None: + _schema.id = cls._schema_data_network_resource_id_read.id + return + + cls._schema_data_network_resource_id_read = _schema_data_network_resource_id_read = AAZObjectType() + + data_network_resource_id_read = _schema_data_network_resource_id_read + data_network_resource_id_read.id = AAZStrType( + flags={"required": True}, + ) + + _schema.id = cls._schema_data_network_resource_id_read.id + + _schema_slice_resource_id_read = None + + @classmethod + def _build_schema_slice_resource_id_read(cls, _schema): + if cls._schema_slice_resource_id_read is not None: + _schema.id = cls._schema_slice_resource_id_read.id + return + + cls._schema_slice_resource_id_read = _schema_slice_resource_id_read = AAZObjectType() + + slice_resource_id_read = _schema_slice_resource_id_read + slice_resource_id_read.id = AAZStrType( + flags={"required": True}, + ) + + _schema.id = cls._schema_slice_resource_id_read.id + + +__all__ = ["Show"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/policy/_update.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/policy/_update.py new file mode 100644 index 00000000000..43ad90132b0 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/policy/_update.py @@ -0,0 +1,880 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network sim policy update", +) +class Update(AAZCommand): + """Update a SIM policy. + + :example: Update sim policy tags + az mobile-network sim policy update -g rg-n sim-policy-name --mobile-network-name mobile-network-name --tags "{tag:test,tag2:test2}" + """ + + _aaz_info = { + "version": "2022-11-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/mobilenetworks/{}/simpolicies/{}", "2022-11-01"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + AZ_SUPPORT_GENERIC_UPDATE = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.mobile_network_name = AAZStrArg( + options=["--mobile-network-name"], + help="The name of the mobile network.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.sim_policy_name = AAZStrArg( + options=["-n", "--name", "--sim-policy-name"], + help="The name of the SIM policy.", + required=True, + id_part="child_name_1", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + + # define Arg Group "Parameters" + + _args_schema = cls._args_schema + _args_schema.tags = AAZDictArg( + options=["--tags"], + arg_group="Parameters", + help="Resource tags.", + nullable=True, + ) + + tags = cls._args_schema.tags + tags.Element = AAZStrArg( + nullable=True, + ) + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.default_slice = AAZObjectArg( + options=["--default-slice"], + arg_group="Properties", + help="The default slice to use if the UE does not explicitly specify it. This slice must exist in the `sliceConfigurations` map.", + ) + cls._build_args_slice_resource_id_update(_args_schema.default_slice) + _args_schema.registration_timer = AAZIntArg( + options=["--registration-timer"], + arg_group="Properties", + help="Interval for the UE periodic registration update procedure, in seconds.", + nullable=True, + fmt=AAZIntArgFormat( + minimum=30, + ), + ) + _args_schema.rfsp_index = AAZIntArg( + options=["--rfsp-index"], + arg_group="Properties", + help="RAT/Frequency Selection Priority Index, defined in 3GPP TS 36.413. This is an optional setting and by default is unspecified.", + nullable=True, + fmt=AAZIntArgFormat( + maximum=256, + minimum=1, + ), + ) + _args_schema.slice_config = AAZListArg( + options=["--slice-config"], + arg_group="Properties", + help="The allowed slices and the settings to use for them. The list must not contain duplicate items and must contain at least one item.", + fmt=AAZListArgFormat( + unique=True, + ), + ) + _args_schema.ue_ambr = AAZObjectArg( + options=["--ue-ambr"], + arg_group="Properties", + help="Aggregate maximum bit rate across all non-GBR QoS flows of all PDU sessions of a given UE. See 3GPP TS23.501 section 5.7.2.6 for a full description of the UE-AMBR.", + ) + cls._build_args_ambr_update(_args_schema.ue_ambr) + + slice_config = cls._args_schema.slice_config + slice_config.Element = AAZObjectArg( + nullable=True, + ) + + _element = cls._args_schema.slice_config.Element + _element.data_network_config = AAZListArg( + options=["data-network-config"], + help="The allowed data networks and the settings to use for them. The list must not contain duplicate items and must contain at least one item.", + fmt=AAZListArgFormat( + unique=True, + ), + ) + _element.default_data_network = AAZObjectArg( + options=["default-data-network"], + help="The default data network to use if the UE does not explicitly specify it. Configuration for this object must exist in the `dataNetworkConfigurations` map.", + ) + cls._build_args_data_network_resource_id_update(_element.default_data_network) + _element.slice = AAZObjectArg( + options=["slice"], + help="A reference to the slice that these settings apply to", + ) + cls._build_args_slice_resource_id_update(_element.slice) + + data_network_config = cls._args_schema.slice_config.Element.data_network_config + data_network_config.Element = AAZObjectArg( + nullable=True, + ) + + _element = cls._args_schema.slice_config.Element.data_network_config.Element + _element.five_qi = AAZIntArg( + options=["five-qi"], + help="Default QoS Flow 5G QoS Indicator value. The 5QI identifies a specific QoS forwarding treatment to be provided to a flow. This must not be a standardized 5QI value corresponding to a GBR (guaranteed bit rate) QoS Flow. The illegal GBR 5QI values are: 1, 2, 3, 4, 65, 66, 67, 71, 72, 73, 74, 75, 76, 82, 83, 84, and 85. See 3GPP TS23.501 section 5.7.2.1 for a full description of the 5QI parameter, and table 5.7.4-1 for the definition of which are the GBR 5QI values.", + nullable=True, + fmt=AAZIntArgFormat( + maximum=255, + minimum=0, + ), + ) + _element.additional_session_type = AAZListArg( + options=["additional-session-type"], + help="Allowed session types in addition to the default session type. Must not duplicate the default session type.", + nullable=True, + ) + _element.arp_level = AAZIntArg( + options=["arp-level"], + help="Default QoS Flow allocation and retention priority (ARP) level. Flows with higher priority preempt flows with lower priority, if the settings of `preemptionCapability` and `preemptionVulnerability` allow it. 1 is the highest level of priority. If this field is not specified then `5qi` is used to derive the ARP value. See 3GPP TS23.501 section 5.7.2.2 for a full description of the ARP parameters.", + nullable=True, + fmt=AAZIntArgFormat( + maximum=15, + minimum=1, + ), + ) + _element.allowed_services = AAZListArg( + options=["allowed-services"], + help="List of services that can be used as part of this SIM policy. The list must not contain duplicate items and must contain at least one item.", + fmt=AAZListArgFormat( + unique=True, + ), + ) + _element.data_network = AAZObjectArg( + options=["data-network"], + help="A reference to the data network that these settings apply to", + ) + cls._build_args_data_network_resource_id_update(_element.data_network) + _element.default_session_type = AAZStrArg( + options=["default-session-type"], + help="The default PDU session type, which is used if the UE does not request a specific session type.", + nullable=True, + enum={"IPv4": "IPv4", "IPv6": "IPv6"}, + ) + _element.maximum_number_of_buffered_packets = AAZIntArg( + options=["maximum-number-of-buffered-packets"], + help="The maximum number of downlink packets to buffer at the user plane for High Latency Communication - Extended Buffering. See 3GPP TS29.272 v15.10.0 section 7.3.188 for a full description. This maximum is not guaranteed because there is a internal limit on buffered packets across all PDU sessions.", + nullable=True, + fmt=AAZIntArgFormat( + minimum=0, + ), + ) + _element.preemption_capability = AAZStrArg( + options=["preemption-capability"], + help="Default QoS Flow preemption capability. The preemption capability of a QoS Flow controls whether it can preempt another QoS Flow with a lower priority level. See 3GPP TS23.501 section 5.7.2.2 for a full description of the ARP parameters.", + nullable=True, + enum={"MayPreempt": "MayPreempt", "NotPreempt": "NotPreempt"}, + ) + _element.preemption_vulnerability = AAZStrArg( + options=["preemption-vulnerability"], + help="Default QoS Flow preemption vulnerability. The preemption vulnerability of a QoS Flow controls whether it can be preempted by a QoS Flow with a higher priority level. See 3GPP TS23.501 section 5.7.2.2 for a full description of the ARP parameters.", + nullable=True, + enum={"NotPreemptable": "NotPreemptable", "Preemptable": "Preemptable"}, + ) + _element.session_ambr = AAZObjectArg( + options=["session-ambr"], + help="Aggregate maximum bit rate across all non-GBR QoS flows of a given PDU session. See 3GPP TS23.501 section 5.7.2.6 for a full description of the Session-AMBR.", + ) + cls._build_args_ambr_update(_element.session_ambr) + + additional_session_type = cls._args_schema.slice_config.Element.data_network_config.Element.additional_session_type + additional_session_type.Element = AAZStrArg( + nullable=True, + enum={"IPv4": "IPv4", "IPv6": "IPv6"}, + ) + + allowed_services = cls._args_schema.slice_config.Element.data_network_config.Element.allowed_services + allowed_services.Element = AAZObjectArg( + nullable=True, + ) + + _element = cls._args_schema.slice_config.Element.data_network_config.Element.allowed_services.Element + _element.id = AAZStrArg( + options=["id"], + help="Service resource ID.", + fmt=AAZStrArgFormat( + pattern="^/[sS][uU][bB][sS][cC][rR][iI][pP][tT][iI][oO][nN][sS]/[^/?#]+/[rR][eE][sS][oO][uU][rR][cC][eE][gG][rR][oO][uU][pP][sS]/[^/?#]+/[pP][rR][oO][vV][iI][dD][eE][rR][sS]/[mM][iI][cC][rR][oO][sS][oO][fF][tT]\.[mM][oO][bB][iI][lL][eE][nN][eE][tT][wW][oO][rR][kK]/[mM][oO][bB][iI][lL][eE][nN][eE][tT][wW][oO][rR][kK][sS]/[^/?#]+/[sS][eE][rR][vV][iI][cC][eE][sS]/[^/?#]+$", + ), + ) + return cls._args_schema + + _args_ambr_update = None + + @classmethod + def _build_args_ambr_update(cls, _schema): + if cls._args_ambr_update is not None: + _schema.downlink = cls._args_ambr_update.downlink + _schema.uplink = cls._args_ambr_update.uplink + return + + cls._args_ambr_update = AAZObjectArg() + + ambr_update = cls._args_ambr_update + ambr_update.downlink = AAZStrArg( + options=["downlink"], + help="Downlink bit rate.", + fmt=AAZStrArgFormat( + pattern="^\d+(\.\d+)? (bps|Kbps|Mbps|Gbps|Tbps)$", + ), + ) + ambr_update.uplink = AAZStrArg( + options=["uplink"], + help="Uplink bit rate.", + fmt=AAZStrArgFormat( + pattern="^\d+(\.\d+)? (bps|Kbps|Mbps|Gbps|Tbps)$", + ), + ) + + _schema.downlink = cls._args_ambr_update.downlink + _schema.uplink = cls._args_ambr_update.uplink + + _args_data_network_resource_id_update = None + + @classmethod + def _build_args_data_network_resource_id_update(cls, _schema): + if cls._args_data_network_resource_id_update is not None: + _schema.id = cls._args_data_network_resource_id_update.id + return + + cls._args_data_network_resource_id_update = AAZObjectArg() + + data_network_resource_id_update = cls._args_data_network_resource_id_update + data_network_resource_id_update.id = AAZStrArg( + options=["id"], + help="Data network resource ID.", + fmt=AAZStrArgFormat( + pattern="^/[sS][uU][bB][sS][cC][rR][iI][pP][tT][iI][oO][nN][sS]/[^/?#]+/[rR][eE][sS][oO][uU][rR][cC][eE][gG][rR][oO][uU][pP][sS]/[^/?#]+/[pP][rR][oO][vV][iI][dD][eE][rR][sS]/[mM][iI][cC][rR][oO][sS][oO][fF][tT]\.[mM][oO][bB][iI][lL][eE][nN][eE][tT][wW][oO][rR][kK]/[mM][oO][bB][iI][lL][eE][nN][eE][tT][wW][oO][rR][kK][sS]/[^/?#]+/[dD][aA][tT][aA][nN][eE][tT][wW][oO][rR][kK][sS]/[^/?#]+$", + ), + ) + + _schema.id = cls._args_data_network_resource_id_update.id + + _args_slice_resource_id_update = None + + @classmethod + def _build_args_slice_resource_id_update(cls, _schema): + if cls._args_slice_resource_id_update is not None: + _schema.id = cls._args_slice_resource_id_update.id + return + + cls._args_slice_resource_id_update = AAZObjectArg() + + slice_resource_id_update = cls._args_slice_resource_id_update + slice_resource_id_update.id = AAZStrArg( + options=["id"], + help="Slice resource ID.", + fmt=AAZStrArgFormat( + pattern="^/[sS][uU][bB][sS][cC][rR][iI][pP][tT][iI][oO][nN][sS]/[^/?#]+/[rR][eE][sS][oO][uU][rR][cC][eE][gG][rR][oO][uU][pP][sS]/[^/?#]+/[pP][rR][oO][vV][iI][dD][eE][rR][sS]/[mM][iI][cC][rR][oO][sS][oO][fF][tT]\.[mM][oO][bB][iI][lL][eE][nN][eE][tT][wW][oO][rR][kK]/[mM][oO][bB][iI][lL][eE][nN][eE][tT][wW][oO][rR][kK][sS]/[^/?#]+/[sS][lL][iI][cC][eE][sS]/[^/?#]+$", + ), + ) + + _schema.id = cls._args_slice_resource_id_update.id + + def _execute_operations(self): + self.pre_operations() + self.SimPoliciesGet(ctx=self.ctx)() + self.pre_instance_update(self.ctx.vars.instance) + self.InstanceUpdateByJson(ctx=self.ctx)() + self.InstanceUpdateByGeneric(ctx=self.ctx)() + self.post_instance_update(self.ctx.vars.instance) + yield self.SimPoliciesCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + @register_callback + def pre_instance_update(self, instance): + pass + + @register_callback + def post_instance_update(self, instance): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class SimPoliciesGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/mobileNetworks/{mobileNetworkName}/simPolicies/{simPolicyName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "mobileNetworkName", self.ctx.args.mobile_network_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "simPolicyName", self.ctx.args.sim_policy_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + _UpdateHelper._build_schema_sim_policy_read(cls._schema_on_200) + + return cls._schema_on_200 + + class SimPoliciesCreateOrUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200, 201]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/mobileNetworks/{mobileNetworkName}/simPolicies/{simPolicyName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "mobileNetworkName", self.ctx.args.mobile_network_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "simPolicyName", self.ctx.args.sim_policy_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + value=self.ctx.vars.instance, + ) + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + _UpdateHelper._build_schema_sim_policy_read(cls._schema_on_200_201) + + return cls._schema_on_200_201 + + class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): + + def __call__(self, *args, **kwargs): + self._update_instance(self.ctx.vars.instance) + + def _update_instance(self, instance): + _instance_value, _builder = self.new_content_builder( + self.ctx.args, + value=instance, + typ=AAZObjectType + ) + _builder.set_prop("properties", AAZObjectType, ".", typ_kwargs={"flags": {"required": True, "client_flatten": True}}) + _builder.set_prop("tags", AAZDictType, ".tags") + + properties = _builder.get(".properties") + if properties is not None: + _UpdateHelper._build_schema_slice_resource_id_update(properties.set_prop("defaultSlice", AAZObjectType, ".default_slice", typ_kwargs={"flags": {"required": True}})) + properties.set_prop("registrationTimer", AAZIntType, ".registration_timer") + properties.set_prop("rfspIndex", AAZIntType, ".rfsp_index") + properties.set_prop("sliceConfigurations", AAZListType, ".slice_config", typ_kwargs={"flags": {"required": True}}) + _UpdateHelper._build_schema_ambr_update(properties.set_prop("ueAmbr", AAZObjectType, ".ue_ambr", typ_kwargs={"flags": {"required": True}})) + + slice_configurations = _builder.get(".properties.sliceConfigurations") + if slice_configurations is not None: + slice_configurations.set_elements(AAZObjectType, ".") + + _elements = _builder.get(".properties.sliceConfigurations[]") + if _elements is not None: + _elements.set_prop("dataNetworkConfigurations", AAZListType, ".data_network_config", typ_kwargs={"flags": {"required": True}}) + _UpdateHelper._build_schema_data_network_resource_id_update(_elements.set_prop("defaultDataNetwork", AAZObjectType, ".default_data_network", typ_kwargs={"flags": {"required": True}})) + _UpdateHelper._build_schema_slice_resource_id_update(_elements.set_prop("slice", AAZObjectType, ".slice", typ_kwargs={"flags": {"required": True}})) + + data_network_configurations = _builder.get(".properties.sliceConfigurations[].dataNetworkConfigurations") + if data_network_configurations is not None: + data_network_configurations.set_elements(AAZObjectType, ".") + + _elements = _builder.get(".properties.sliceConfigurations[].dataNetworkConfigurations[]") + if _elements is not None: + _elements.set_prop("5qi", AAZIntType, ".five_qi") + _elements.set_prop("additionalAllowedSessionTypes", AAZListType, ".additional_session_type") + _elements.set_prop("allocationAndRetentionPriorityLevel", AAZIntType, ".arp_level") + _elements.set_prop("allowedServices", AAZListType, ".allowed_services", typ_kwargs={"flags": {"required": True}}) + _UpdateHelper._build_schema_data_network_resource_id_update(_elements.set_prop("dataNetwork", AAZObjectType, ".data_network", typ_kwargs={"flags": {"required": True}})) + _elements.set_prop("defaultSessionType", AAZStrType, ".default_session_type") + _elements.set_prop("maximumNumberOfBufferedPackets", AAZIntType, ".maximum_number_of_buffered_packets") + _elements.set_prop("preemptionCapability", AAZStrType, ".preemption_capability") + _elements.set_prop("preemptionVulnerability", AAZStrType, ".preemption_vulnerability") + _UpdateHelper._build_schema_ambr_update(_elements.set_prop("sessionAmbr", AAZObjectType, ".session_ambr", typ_kwargs={"flags": {"required": True}})) + + additional_allowed_session_types = _builder.get(".properties.sliceConfigurations[].dataNetworkConfigurations[].additionalAllowedSessionTypes") + if additional_allowed_session_types is not None: + additional_allowed_session_types.set_elements(AAZStrType, ".") + + allowed_services = _builder.get(".properties.sliceConfigurations[].dataNetworkConfigurations[].allowedServices") + if allowed_services is not None: + allowed_services.set_elements(AAZObjectType, ".") + + _elements = _builder.get(".properties.sliceConfigurations[].dataNetworkConfigurations[].allowedServices[]") + if _elements is not None: + _elements.set_prop("id", AAZStrType, ".id", typ_kwargs={"flags": {"required": True}}) + + tags = _builder.get(".tags") + if tags is not None: + tags.set_elements(AAZStrType, ".") + + return _instance_value + + class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): + + def __call__(self, *args, **kwargs): + self._update_instance_by_generic( + self.ctx.vars.instance, + self.ctx.generic_update_args + ) + + +class _UpdateHelper: + """Helper class for Update""" + + @classmethod + def _build_schema_ambr_update(cls, _builder): + if _builder is None: + return + _builder.set_prop("downlink", AAZStrType, ".downlink", typ_kwargs={"flags": {"required": True}}) + _builder.set_prop("uplink", AAZStrType, ".uplink", typ_kwargs={"flags": {"required": True}}) + + @classmethod + def _build_schema_data_network_resource_id_update(cls, _builder): + if _builder is None: + return + _builder.set_prop("id", AAZStrType, ".id", typ_kwargs={"flags": {"required": True}}) + + @classmethod + def _build_schema_slice_resource_id_update(cls, _builder): + if _builder is None: + return + _builder.set_prop("id", AAZStrType, ".id", typ_kwargs={"flags": {"required": True}}) + + _schema_ambr_read = None + + @classmethod + def _build_schema_ambr_read(cls, _schema): + if cls._schema_ambr_read is not None: + _schema.downlink = cls._schema_ambr_read.downlink + _schema.uplink = cls._schema_ambr_read.uplink + return + + cls._schema_ambr_read = _schema_ambr_read = AAZObjectType() + + ambr_read = _schema_ambr_read + ambr_read.downlink = AAZStrType( + flags={"required": True}, + ) + ambr_read.uplink = AAZStrType( + flags={"required": True}, + ) + + _schema.downlink = cls._schema_ambr_read.downlink + _schema.uplink = cls._schema_ambr_read.uplink + + _schema_data_network_resource_id_read = None + + @classmethod + def _build_schema_data_network_resource_id_read(cls, _schema): + if cls._schema_data_network_resource_id_read is not None: + _schema.id = cls._schema_data_network_resource_id_read.id + return + + cls._schema_data_network_resource_id_read = _schema_data_network_resource_id_read = AAZObjectType() + + data_network_resource_id_read = _schema_data_network_resource_id_read + data_network_resource_id_read.id = AAZStrType( + flags={"required": True}, + ) + + _schema.id = cls._schema_data_network_resource_id_read.id + + _schema_sim_policy_read = None + + @classmethod + def _build_schema_sim_policy_read(cls, _schema): + if cls._schema_sim_policy_read is not None: + _schema.id = cls._schema_sim_policy_read.id + _schema.location = cls._schema_sim_policy_read.location + _schema.name = cls._schema_sim_policy_read.name + _schema.properties = cls._schema_sim_policy_read.properties + _schema.system_data = cls._schema_sim_policy_read.system_data + _schema.tags = cls._schema_sim_policy_read.tags + _schema.type = cls._schema_sim_policy_read.type + return + + cls._schema_sim_policy_read = _schema_sim_policy_read = AAZObjectType() + + sim_policy_read = _schema_sim_policy_read + sim_policy_read.id = AAZStrType( + flags={"read_only": True}, + ) + sim_policy_read.location = AAZStrType( + flags={"required": True}, + ) + sim_policy_read.name = AAZStrType( + flags={"read_only": True}, + ) + sim_policy_read.properties = AAZObjectType( + flags={"required": True, "client_flatten": True}, + ) + sim_policy_read.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + sim_policy_read.tags = AAZDictType() + sim_policy_read.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = _schema_sim_policy_read.properties + properties.default_slice = AAZObjectType( + serialized_name="defaultSlice", + flags={"required": True}, + ) + cls._build_schema_slice_resource_id_read(properties.default_slice) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.registration_timer = AAZIntType( + serialized_name="registrationTimer", + ) + properties.rfsp_index = AAZIntType( + serialized_name="rfspIndex", + ) + properties.site_provisioning_state = AAZDictType( + serialized_name="siteProvisioningState", + flags={"read_only": True}, + ) + properties.slice_configurations = AAZListType( + serialized_name="sliceConfigurations", + flags={"required": True}, + ) + properties.ue_ambr = AAZObjectType( + serialized_name="ueAmbr", + flags={"required": True}, + ) + cls._build_schema_ambr_read(properties.ue_ambr) + + site_provisioning_state = _schema_sim_policy_read.properties.site_provisioning_state + site_provisioning_state.Element = AAZStrType( + flags={"read_only": True}, + ) + + slice_configurations = _schema_sim_policy_read.properties.slice_configurations + slice_configurations.Element = AAZObjectType() + + _element = _schema_sim_policy_read.properties.slice_configurations.Element + _element.data_network_configurations = AAZListType( + serialized_name="dataNetworkConfigurations", + flags={"required": True}, + ) + _element.default_data_network = AAZObjectType( + serialized_name="defaultDataNetwork", + flags={"required": True}, + ) + cls._build_schema_data_network_resource_id_read(_element.default_data_network) + _element.slice = AAZObjectType( + flags={"required": True}, + ) + cls._build_schema_slice_resource_id_read(_element.slice) + + data_network_configurations = _schema_sim_policy_read.properties.slice_configurations.Element.data_network_configurations + data_network_configurations.Element = AAZObjectType() + + _element = _schema_sim_policy_read.properties.slice_configurations.Element.data_network_configurations.Element + _element["5qi"] = AAZIntType() + _element.additional_allowed_session_types = AAZListType( + serialized_name="additionalAllowedSessionTypes", + ) + _element.allocation_and_retention_priority_level = AAZIntType( + serialized_name="allocationAndRetentionPriorityLevel", + ) + _element.allowed_services = AAZListType( + serialized_name="allowedServices", + flags={"required": True}, + ) + _element.data_network = AAZObjectType( + serialized_name="dataNetwork", + flags={"required": True}, + ) + cls._build_schema_data_network_resource_id_read(_element.data_network) + _element.default_session_type = AAZStrType( + serialized_name="defaultSessionType", + ) + _element.maximum_number_of_buffered_packets = AAZIntType( + serialized_name="maximumNumberOfBufferedPackets", + ) + _element.preemption_capability = AAZStrType( + serialized_name="preemptionCapability", + ) + _element.preemption_vulnerability = AAZStrType( + serialized_name="preemptionVulnerability", + ) + _element.session_ambr = AAZObjectType( + serialized_name="sessionAmbr", + flags={"required": True}, + ) + cls._build_schema_ambr_read(_element.session_ambr) + + additional_allowed_session_types = _schema_sim_policy_read.properties.slice_configurations.Element.data_network_configurations.Element.additional_allowed_session_types + additional_allowed_session_types.Element = AAZStrType() + + allowed_services = _schema_sim_policy_read.properties.slice_configurations.Element.data_network_configurations.Element.allowed_services + allowed_services.Element = AAZObjectType() + + _element = _schema_sim_policy_read.properties.slice_configurations.Element.data_network_configurations.Element.allowed_services.Element + _element.id = AAZStrType( + flags={"required": True}, + ) + + system_data = _schema_sim_policy_read.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = _schema_sim_policy_read.tags + tags.Element = AAZStrType() + + _schema.id = cls._schema_sim_policy_read.id + _schema.location = cls._schema_sim_policy_read.location + _schema.name = cls._schema_sim_policy_read.name + _schema.properties = cls._schema_sim_policy_read.properties + _schema.system_data = cls._schema_sim_policy_read.system_data + _schema.tags = cls._schema_sim_policy_read.tags + _schema.type = cls._schema_sim_policy_read.type + + _schema_slice_resource_id_read = None + + @classmethod + def _build_schema_slice_resource_id_read(cls, _schema): + if cls._schema_slice_resource_id_read is not None: + _schema.id = cls._schema_slice_resource_id_read.id + return + + cls._schema_slice_resource_id_read = _schema_slice_resource_id_read = AAZObjectType() + + slice_resource_id_read = _schema_slice_resource_id_read + slice_resource_id_read.id = AAZStrType( + flags={"required": True}, + ) + + _schema.id = cls._schema_slice_resource_id_read.id + + +__all__ = ["Update"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/policy/_wait.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/policy/_wait.py new file mode 100644 index 00000000000..e4a6773f59c --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/policy/_wait.py @@ -0,0 +1,379 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network sim policy wait", +) +class Wait(AAZWaitCommand): + """Place the CLI in a waiting state until a condition is met. + """ + + _aaz_info = { + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/mobilenetworks/{}/simpolicies/{}", "2022-11-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.mobile_network_name = AAZStrArg( + options=["--mobile-network-name"], + help="The name of the mobile network.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.sim_policy_name = AAZStrArg( + options=["-n", "--name", "--sim-policy-name"], + help="The name of the SIM policy.", + required=True, + id_part="child_name_1", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.SimPoliciesGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) + return result + + class SimPoliciesGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/mobileNetworks/{mobileNetworkName}/simPolicies/{simPolicyName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "mobileNetworkName", self.ctx.args.mobile_network_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "simPolicyName", self.ctx.args.sim_policy_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.location = AAZStrType( + flags={"required": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType( + flags={"required": True, "client_flatten": True}, + ) + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.default_slice = AAZObjectType( + serialized_name="defaultSlice", + flags={"required": True}, + ) + _WaitHelper._build_schema_slice_resource_id_read(properties.default_slice) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.registration_timer = AAZIntType( + serialized_name="registrationTimer", + ) + properties.rfsp_index = AAZIntType( + serialized_name="rfspIndex", + ) + properties.site_provisioning_state = AAZDictType( + serialized_name="siteProvisioningState", + flags={"read_only": True}, + ) + properties.slice_configurations = AAZListType( + serialized_name="sliceConfigurations", + flags={"required": True}, + ) + properties.ue_ambr = AAZObjectType( + serialized_name="ueAmbr", + flags={"required": True}, + ) + _WaitHelper._build_schema_ambr_read(properties.ue_ambr) + + site_provisioning_state = cls._schema_on_200.properties.site_provisioning_state + site_provisioning_state.Element = AAZStrType( + flags={"read_only": True}, + ) + + slice_configurations = cls._schema_on_200.properties.slice_configurations + slice_configurations.Element = AAZObjectType() + + _element = cls._schema_on_200.properties.slice_configurations.Element + _element.data_network_configurations = AAZListType( + serialized_name="dataNetworkConfigurations", + flags={"required": True}, + ) + _element.default_data_network = AAZObjectType( + serialized_name="defaultDataNetwork", + flags={"required": True}, + ) + _WaitHelper._build_schema_data_network_resource_id_read(_element.default_data_network) + _element.slice = AAZObjectType( + flags={"required": True}, + ) + _WaitHelper._build_schema_slice_resource_id_read(_element.slice) + + data_network_configurations = cls._schema_on_200.properties.slice_configurations.Element.data_network_configurations + data_network_configurations.Element = AAZObjectType() + + _element = cls._schema_on_200.properties.slice_configurations.Element.data_network_configurations.Element + _element["5qi"] = AAZIntType() + _element.additional_allowed_session_types = AAZListType( + serialized_name="additionalAllowedSessionTypes", + ) + _element.allocation_and_retention_priority_level = AAZIntType( + serialized_name="allocationAndRetentionPriorityLevel", + ) + _element.allowed_services = AAZListType( + serialized_name="allowedServices", + flags={"required": True}, + ) + _element.data_network = AAZObjectType( + serialized_name="dataNetwork", + flags={"required": True}, + ) + _WaitHelper._build_schema_data_network_resource_id_read(_element.data_network) + _element.default_session_type = AAZStrType( + serialized_name="defaultSessionType", + ) + _element.maximum_number_of_buffered_packets = AAZIntType( + serialized_name="maximumNumberOfBufferedPackets", + ) + _element.preemption_capability = AAZStrType( + serialized_name="preemptionCapability", + ) + _element.preemption_vulnerability = AAZStrType( + serialized_name="preemptionVulnerability", + ) + _element.session_ambr = AAZObjectType( + serialized_name="sessionAmbr", + flags={"required": True}, + ) + _WaitHelper._build_schema_ambr_read(_element.session_ambr) + + additional_allowed_session_types = cls._schema_on_200.properties.slice_configurations.Element.data_network_configurations.Element.additional_allowed_session_types + additional_allowed_session_types.Element = AAZStrType() + + allowed_services = cls._schema_on_200.properties.slice_configurations.Element.data_network_configurations.Element.allowed_services + allowed_services.Element = AAZObjectType() + + _element = cls._schema_on_200.properties.slice_configurations.Element.data_network_configurations.Element.allowed_services.Element + _element.id = AAZStrType( + flags={"required": True}, + ) + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _WaitHelper: + """Helper class for Wait""" + + _schema_ambr_read = None + + @classmethod + def _build_schema_ambr_read(cls, _schema): + if cls._schema_ambr_read is not None: + _schema.downlink = cls._schema_ambr_read.downlink + _schema.uplink = cls._schema_ambr_read.uplink + return + + cls._schema_ambr_read = _schema_ambr_read = AAZObjectType() + + ambr_read = _schema_ambr_read + ambr_read.downlink = AAZStrType( + flags={"required": True}, + ) + ambr_read.uplink = AAZStrType( + flags={"required": True}, + ) + + _schema.downlink = cls._schema_ambr_read.downlink + _schema.uplink = cls._schema_ambr_read.uplink + + _schema_data_network_resource_id_read = None + + @classmethod + def _build_schema_data_network_resource_id_read(cls, _schema): + if cls._schema_data_network_resource_id_read is not None: + _schema.id = cls._schema_data_network_resource_id_read.id + return + + cls._schema_data_network_resource_id_read = _schema_data_network_resource_id_read = AAZObjectType() + + data_network_resource_id_read = _schema_data_network_resource_id_read + data_network_resource_id_read.id = AAZStrType( + flags={"required": True}, + ) + + _schema.id = cls._schema_data_network_resource_id_read.id + + _schema_slice_resource_id_read = None + + @classmethod + def _build_schema_slice_resource_id_read(cls, _schema): + if cls._schema_slice_resource_id_read is not None: + _schema.id = cls._schema_slice_resource_id_read.id + return + + cls._schema_slice_resource_id_read = _schema_slice_resource_id_read = AAZObjectType() + + slice_resource_id_read = _schema_slice_resource_id_read + slice_resource_id_read.id = AAZStrType( + flags={"required": True}, + ) + + _schema.id = cls._schema_slice_resource_id_read.id + + +__all__ = ["Wait"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/site/__cmd_group.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/site/__cmd_group.py new file mode 100644 index 00000000000..ed148cf0a76 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/site/__cmd_group.py @@ -0,0 +1,23 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command_group( + "mobile-network site", +) +class __CMDGroup(AAZCommandGroup): + """Manage site + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/site/__init__.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/site/__init__.py new file mode 100644 index 00000000000..db73033039b --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/site/__init__.py @@ -0,0 +1,17 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * +from ._create import * +from ._delete import * +from ._list import * +from ._show import * +from ._update import * +from ._wait import * diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/site/_create.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/site/_create.py new file mode 100644 index 00000000000..4fe8cfd4703 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/site/_create.py @@ -0,0 +1,297 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network site create", +) +class Create(AAZCommand): + """Create a mobile network site. + + :example: Create site + az mobile-network create -n mobile-network-name -g rg --identifier "{mcc:001,mnc:01}" + """ + + _aaz_info = { + "version": "2022-11-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/mobilenetworks/{}/sites/{}", "2022-11-01"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.mobile_network_name = AAZStrArg( + options=["--mobile-network-name"], + help="The name of the mobile network.", + required=True, + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.site_name = AAZStrArg( + options=["-n", "--name", "--site-name"], + help="The name of the mobile network site.", + required=True, + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + + # define Arg Group "Parameters" + + _args_schema = cls._args_schema + _args_schema.location = AAZResourceLocationArg( + arg_group="Parameters", + help="The geo-location where the resource lives", + required=True, + fmt=AAZResourceLocationArgFormat( + resource_group_arg="resource_group", + ), + ) + _args_schema.tags = AAZDictArg( + options=["--tags"], + arg_group="Parameters", + help="Resource tags.", + ) + + tags = cls._args_schema.tags + tags.Element = AAZStrArg() + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + yield self.SitesCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class SitesCreateOrUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200, 201]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/mobileNetworks/{mobileNetworkName}/sites/{siteName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "mobileNetworkName", self.ctx.args.mobile_network_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "siteName", self.ctx.args.site_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + typ=AAZObjectType, + typ_kwargs={"flags": {"required": True, "client_flatten": True}} + ) + _builder.set_prop("location", AAZStrType, ".location", typ_kwargs={"flags": {"required": True}}) + _builder.set_prop("tags", AAZDictType, ".tags") + + tags = _builder.get(".tags") + if tags is not None: + tags.set_elements(AAZStrType, ".") + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + + _schema_on_200_201 = cls._schema_on_200_201 + _schema_on_200_201.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.location = AAZStrType( + flags={"required": True}, + ) + _schema_on_200_201.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _schema_on_200_201.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200_201.tags = AAZDictType() + _schema_on_200_201.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200_201.properties + properties.network_functions = AAZListType( + serialized_name="networkFunctions", + flags={"read_only": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + network_functions = cls._schema_on_200_201.properties.network_functions + network_functions.Element = AAZObjectType() + + _element = cls._schema_on_200_201.properties.network_functions.Element + _element.id = AAZStrType( + flags={"required": True}, + ) + + system_data = cls._schema_on_200_201.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200_201.tags + tags.Element = AAZStrType() + + return cls._schema_on_200_201 + + +class _CreateHelper: + """Helper class for Create""" + + +__all__ = ["Create"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/site/_delete.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/site/_delete.py new file mode 100644 index 00000000000..9c66ca8d453 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/site/_delete.py @@ -0,0 +1,181 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network site delete", + confirmation="Are you sure you want to perform this operation?", +) +class Delete(AAZCommand): + """Delete the specified mobile network site. + + :example: Delete site + az mobile-network site delete --mobile-network-name mobile-network-name -n site-name -g rg -y' + """ + + _aaz_info = { + "version": "2022-11-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/mobilenetworks/{}/sites/{}", "2022-11-01"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, None) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.mobile_network_name = AAZStrArg( + options=["--mobile-network-name"], + help="The name of the mobile network.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.site_name = AAZStrArg( + options=["-n", "--name", "--site-name"], + help="The name of the mobile network site.", + required=True, + id_part="child_name_1", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + yield self.SitesDelete(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + class SitesDelete(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [204]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_204, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/mobileNetworks/{mobileNetworkName}/sites/{siteName}", + **self.url_parameters + ) + + @property + def method(self): + return "DELETE" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "mobileNetworkName", self.ctx.args.mobile_network_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "siteName", self.ctx.args.site_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + def on_200(self, session): + pass + + def on_204(self, session): + pass + + +class _DeleteHelper: + """Helper class for Delete""" + + +__all__ = ["Delete"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/site/_list.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/site/_list.py new file mode 100644 index 00000000000..a4386e571ff --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/site/_list.py @@ -0,0 +1,238 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network site list", +) +class List(AAZCommand): + """List all sites in the mobile network. + + :example: List site by resource group + az mobile-network site list --mobile-network-name mobile-network-name -g rg + """ + + _aaz_info = { + "version": "2022-11-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/mobilenetworks/{}/sites", "2022-11-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_paging(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.mobile_network_name = AAZStrArg( + options=["--mobile-network-name"], + help="The name of the mobile network.", + required=True, + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.SitesListByMobileNetwork(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) + next_link = self.deserialize_output(self.ctx.vars.instance.next_link) + return result, next_link + + class SitesListByMobileNetwork(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/mobileNetworks/{mobileNetworkName}/sites", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "mobileNetworkName", self.ctx.args.mobile_network_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.next_link = AAZStrType( + serialized_name="nextLink", + flags={"read_only": True}, + ) + _schema_on_200.value = AAZListType() + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.location = AAZStrType( + flags={"required": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _element.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _element.tags = AAZDictType() + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.network_functions = AAZListType( + serialized_name="networkFunctions", + flags={"read_only": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + network_functions = cls._schema_on_200.value.Element.properties.network_functions + network_functions.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element.properties.network_functions.Element + _element.id = AAZStrType( + flags={"required": True}, + ) + + system_data = cls._schema_on_200.value.Element.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.value.Element.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _ListHelper: + """Helper class for List""" + + +__all__ = ["List"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/site/_show.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/site/_show.py new file mode 100644 index 00000000000..bb8192b38e9 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/site/_show.py @@ -0,0 +1,243 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network site show", +) +class Show(AAZCommand): + """Get information about the specified mobile network site. + + :example: Show site + az mobile-network site show--mobile-network-name mobile-network-name -n site-name -g rg + """ + + _aaz_info = { + "version": "2022-11-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/mobilenetworks/{}/sites/{}", "2022-11-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.mobile_network_name = AAZStrArg( + options=["--mobile-network-name"], + help="The name of the mobile network.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.site_name = AAZStrArg( + options=["-n", "--name", "--site-name"], + help="The name of the mobile network site.", + required=True, + id_part="child_name_1", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.SitesGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class SitesGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/mobileNetworks/{mobileNetworkName}/sites/{siteName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "mobileNetworkName", self.ctx.args.mobile_network_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "siteName", self.ctx.args.site_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.location = AAZStrType( + flags={"required": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.network_functions = AAZListType( + serialized_name="networkFunctions", + flags={"read_only": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + network_functions = cls._schema_on_200.properties.network_functions + network_functions.Element = AAZObjectType() + + _element = cls._schema_on_200.properties.network_functions.Element + _element.id = AAZStrType( + flags={"required": True}, + ) + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _ShowHelper: + """Helper class for Show""" + + +__all__ = ["Show"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/site/_update.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/site/_update.py new file mode 100644 index 00000000000..64954c89d47 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/site/_update.py @@ -0,0 +1,441 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network site update", +) +class Update(AAZCommand): + """Update a mobile network site. + + :example: Update site tags + az mobile-network site update --mobile-network-name mobile-network-name -n site-name -g rg --tags "{tag:test,tag2:test2}" + """ + + _aaz_info = { + "version": "2022-11-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/mobilenetworks/{}/sites/{}", "2022-11-01"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + AZ_SUPPORT_GENERIC_UPDATE = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.mobile_network_name = AAZStrArg( + options=["--mobile-network-name"], + help="The name of the mobile network.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.site_name = AAZStrArg( + options=["-n", "--name", "--site-name"], + help="The name of the mobile network site.", + required=True, + id_part="child_name_1", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + + # define Arg Group "Parameters" + + _args_schema = cls._args_schema + _args_schema.tags = AAZDictArg( + options=["--tags"], + arg_group="Parameters", + help="Resource tags.", + nullable=True, + ) + + tags = cls._args_schema.tags + tags.Element = AAZStrArg( + nullable=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.SitesGet(ctx=self.ctx)() + self.pre_instance_update(self.ctx.vars.instance) + self.InstanceUpdateByJson(ctx=self.ctx)() + self.InstanceUpdateByGeneric(ctx=self.ctx)() + self.post_instance_update(self.ctx.vars.instance) + yield self.SitesCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + @register_callback + def pre_instance_update(self, instance): + pass + + @register_callback + def post_instance_update(self, instance): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class SitesGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/mobileNetworks/{mobileNetworkName}/sites/{siteName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "mobileNetworkName", self.ctx.args.mobile_network_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "siteName", self.ctx.args.site_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + _UpdateHelper._build_schema_site_read(cls._schema_on_200) + + return cls._schema_on_200 + + class SitesCreateOrUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200, 201]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/mobileNetworks/{mobileNetworkName}/sites/{siteName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "mobileNetworkName", self.ctx.args.mobile_network_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "siteName", self.ctx.args.site_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + value=self.ctx.vars.instance, + ) + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + _UpdateHelper._build_schema_site_read(cls._schema_on_200_201) + + return cls._schema_on_200_201 + + class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): + + def __call__(self, *args, **kwargs): + self._update_instance(self.ctx.vars.instance) + + def _update_instance(self, instance): + _instance_value, _builder = self.new_content_builder( + self.ctx.args, + value=instance, + typ=AAZObjectType + ) + _builder.set_prop("tags", AAZDictType, ".tags") + + tags = _builder.get(".tags") + if tags is not None: + tags.set_elements(AAZStrType, ".") + + return _instance_value + + class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): + + def __call__(self, *args, **kwargs): + self._update_instance_by_generic( + self.ctx.vars.instance, + self.ctx.generic_update_args + ) + + +class _UpdateHelper: + """Helper class for Update""" + + _schema_site_read = None + + @classmethod + def _build_schema_site_read(cls, _schema): + if cls._schema_site_read is not None: + _schema.id = cls._schema_site_read.id + _schema.location = cls._schema_site_read.location + _schema.name = cls._schema_site_read.name + _schema.properties = cls._schema_site_read.properties + _schema.system_data = cls._schema_site_read.system_data + _schema.tags = cls._schema_site_read.tags + _schema.type = cls._schema_site_read.type + return + + cls._schema_site_read = _schema_site_read = AAZObjectType() + + site_read = _schema_site_read + site_read.id = AAZStrType( + flags={"read_only": True}, + ) + site_read.location = AAZStrType( + flags={"required": True}, + ) + site_read.name = AAZStrType( + flags={"read_only": True}, + ) + site_read.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + site_read.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + site_read.tags = AAZDictType() + site_read.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = _schema_site_read.properties + properties.network_functions = AAZListType( + serialized_name="networkFunctions", + flags={"read_only": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + network_functions = _schema_site_read.properties.network_functions + network_functions.Element = AAZObjectType() + + _element = _schema_site_read.properties.network_functions.Element + _element.id = AAZStrType( + flags={"required": True}, + ) + + system_data = _schema_site_read.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = _schema_site_read.tags + tags.Element = AAZStrType() + + _schema.id = cls._schema_site_read.id + _schema.location = cls._schema_site_read.location + _schema.name = cls._schema_site_read.name + _schema.properties = cls._schema_site_read.properties + _schema.system_data = cls._schema_site_read.system_data + _schema.tags = cls._schema_site_read.tags + _schema.type = cls._schema_site_read.type + + +__all__ = ["Update"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/site/_wait.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/site/_wait.py new file mode 100644 index 00000000000..b5ecddca136 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/site/_wait.py @@ -0,0 +1,239 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network site wait", +) +class Wait(AAZWaitCommand): + """Place the CLI in a waiting state until a condition is met. + """ + + _aaz_info = { + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/mobilenetworks/{}/sites/{}", "2022-11-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.mobile_network_name = AAZStrArg( + options=["--mobile-network-name"], + help="The name of the mobile network.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.site_name = AAZStrArg( + options=["-n", "--name", "--site-name"], + help="The name of the mobile network site.", + required=True, + id_part="child_name_1", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.SitesGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) + return result + + class SitesGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/mobileNetworks/{mobileNetworkName}/sites/{siteName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "mobileNetworkName", self.ctx.args.mobile_network_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "siteName", self.ctx.args.site_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.location = AAZStrType( + flags={"required": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.network_functions = AAZListType( + serialized_name="networkFunctions", + flags={"read_only": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + network_functions = cls._schema_on_200.properties.network_functions + network_functions.Element = AAZObjectType() + + _element = cls._schema_on_200.properties.network_functions.Element + _element.id = AAZStrType( + flags={"required": True}, + ) + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _WaitHelper: + """Helper class for Wait""" + + +__all__ = ["Wait"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/slice/__cmd_group.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/slice/__cmd_group.py new file mode 100644 index 00000000000..b14d6dd1c85 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/slice/__cmd_group.py @@ -0,0 +1,23 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command_group( + "mobile-network slice", +) +class __CMDGroup(AAZCommandGroup): + """Manage slice + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/slice/__init__.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/slice/__init__.py new file mode 100644 index 00000000000..db73033039b --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/slice/__init__.py @@ -0,0 +1,17 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * +from ._create import * +from ._delete import * +from ._list import * +from ._show import * +from ._update import * +from ._wait import * diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/slice/_create.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/slice/_create.py new file mode 100644 index 00000000000..b2c8a306cee --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/slice/_create.py @@ -0,0 +1,339 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network slice create", +) +class Create(AAZCommand): + """Create a network slice. + + :example: Create slice + az mobile-network slice create --mobile-network-name mobile-network-name -n slice-name -g rg --snssai "{sst:1,sd:123abc}" + """ + + _aaz_info = { + "version": "2022-11-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/mobilenetworks/{}/slices/{}", "2022-11-01"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.mobile_network_name = AAZStrArg( + options=["--mobile-network-name"], + help="The name of the mobile network.", + required=True, + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.slice_name = AAZStrArg( + options=["-n", "--name", "--slice-name"], + help="The name of the network slice.", + required=True, + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + + # define Arg Group "Parameters" + + _args_schema = cls._args_schema + _args_schema.location = AAZResourceLocationArg( + arg_group="Parameters", + help="The geo-location where the resource lives", + required=True, + fmt=AAZResourceLocationArgFormat( + resource_group_arg="resource_group", + ), + ) + _args_schema.tags = AAZDictArg( + options=["--tags"], + arg_group="Parameters", + help="Resource tags.", + ) + + tags = cls._args_schema.tags + tags.Element = AAZStrArg() + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.description = AAZStrArg( + options=["--description"], + arg_group="Properties", + help="An optional description for this network slice.", + ) + _args_schema.snssai = AAZObjectArg( + options=["--snssai"], + arg_group="Properties", + help="Single-network slice selection assistance information (S-NSSAI). Unique at the scope of a mobile network.", + required=True, + ) + + snssai = cls._args_schema.snssai + snssai.sd = AAZStrArg( + options=["sd"], + help="Slice differentiator (SD).", + fmt=AAZStrArgFormat( + pattern="^[A-Fa-f0-9]{6}$", + ), + ) + snssai.sst = AAZIntArg( + options=["sst"], + help="Slice/service type (SST).", + required=True, + fmt=AAZIntArgFormat( + maximum=255, + minimum=0, + ), + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + yield self.SlicesCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class SlicesCreateOrUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200, 201]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/mobileNetworks/{mobileNetworkName}/slices/{sliceName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "mobileNetworkName", self.ctx.args.mobile_network_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "sliceName", self.ctx.args.slice_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + typ=AAZObjectType, + typ_kwargs={"flags": {"required": True, "client_flatten": True}} + ) + _builder.set_prop("location", AAZStrType, ".location", typ_kwargs={"flags": {"required": True}}) + _builder.set_prop("properties", AAZObjectType, ".", typ_kwargs={"flags": {"required": True, "client_flatten": True}}) + _builder.set_prop("tags", AAZDictType, ".tags") + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("description", AAZStrType, ".description") + properties.set_prop("snssai", AAZObjectType, ".snssai", typ_kwargs={"flags": {"required": True}}) + + snssai = _builder.get(".properties.snssai") + if snssai is not None: + snssai.set_prop("sd", AAZStrType, ".sd") + snssai.set_prop("sst", AAZIntType, ".sst", typ_kwargs={"flags": {"required": True}}) + + tags = _builder.get(".tags") + if tags is not None: + tags.set_elements(AAZStrType, ".") + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + + _schema_on_200_201 = cls._schema_on_200_201 + _schema_on_200_201.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.location = AAZStrType( + flags={"required": True}, + ) + _schema_on_200_201.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.properties = AAZObjectType( + flags={"required": True, "client_flatten": True}, + ) + _schema_on_200_201.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200_201.tags = AAZDictType() + _schema_on_200_201.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200_201.properties + properties.description = AAZStrType() + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.snssai = AAZObjectType( + flags={"required": True}, + ) + + snssai = cls._schema_on_200_201.properties.snssai + snssai.sd = AAZStrType() + snssai.sst = AAZIntType( + flags={"required": True}, + ) + + system_data = cls._schema_on_200_201.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200_201.tags + tags.Element = AAZStrType() + + return cls._schema_on_200_201 + + +class _CreateHelper: + """Helper class for Create""" + + +__all__ = ["Create"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/slice/_delete.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/slice/_delete.py new file mode 100644 index 00000000000..2c727241f7e --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/slice/_delete.py @@ -0,0 +1,181 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network slice delete", + confirmation="Are you sure you want to perform this operation?", +) +class Delete(AAZCommand): + """Delete the specified network slice. + + :example: Delete slice + az mobile-network slice delete --mobile-network-name mobilenetwork-name -n slice-name -g rg -y + """ + + _aaz_info = { + "version": "2022-11-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/mobilenetworks/{}/slices/{}", "2022-11-01"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, None) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.mobile_network_name = AAZStrArg( + options=["--mobile-network-name"], + help="The name of the mobile network.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.slice_name = AAZStrArg( + options=["-n", "--name", "--slice-name"], + help="The name of the network slice.", + required=True, + id_part="child_name_1", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + yield self.SlicesDelete(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + class SlicesDelete(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [204]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_204, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/mobileNetworks/{mobileNetworkName}/slices/{sliceName}", + **self.url_parameters + ) + + @property + def method(self): + return "DELETE" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "mobileNetworkName", self.ctx.args.mobile_network_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "sliceName", self.ctx.args.slice_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + def on_200(self, session): + pass + + def on_204(self, session): + pass + + +class _DeleteHelper: + """Helper class for Delete""" + + +__all__ = ["Delete"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/slice/_list.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/slice/_list.py new file mode 100644 index 00000000000..abd70ac353c --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/slice/_list.py @@ -0,0 +1,236 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network slice list", +) +class List(AAZCommand): + """List all slices in the mobile network. + + :example: List slice by resource group + az mobile-network slice list --mobile-network-name mobile-network-name -g rg + """ + + _aaz_info = { + "version": "2022-11-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/mobilenetworks/{}/slices", "2022-11-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_paging(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.mobile_network_name = AAZStrArg( + options=["--mobile-network-name"], + help="The name of the mobile network.", + required=True, + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.SlicesListByMobileNetwork(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) + next_link = self.deserialize_output(self.ctx.vars.instance.next_link) + return result, next_link + + class SlicesListByMobileNetwork(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/mobileNetworks/{mobileNetworkName}/slices", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "mobileNetworkName", self.ctx.args.mobile_network_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.next_link = AAZStrType( + serialized_name="nextLink", + flags={"read_only": True}, + ) + _schema_on_200.value = AAZListType() + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.location = AAZStrType( + flags={"required": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType( + flags={"required": True, "client_flatten": True}, + ) + _element.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _element.tags = AAZDictType() + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.description = AAZStrType() + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.snssai = AAZObjectType( + flags={"required": True}, + ) + + snssai = cls._schema_on_200.value.Element.properties.snssai + snssai.sd = AAZStrType() + snssai.sst = AAZIntType( + flags={"required": True}, + ) + + system_data = cls._schema_on_200.value.Element.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.value.Element.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _ListHelper: + """Helper class for List""" + + +__all__ = ["List"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/slice/_show.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/slice/_show.py new file mode 100644 index 00000000000..86a4e7880d5 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/slice/_show.py @@ -0,0 +1,241 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network slice show", +) +class Show(AAZCommand): + """Get information about the specified network slice. + + :example: Show slice + az mobile-network slice show --mobile-network-name mobile=network-name -n slice-name -g rg + """ + + _aaz_info = { + "version": "2022-11-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/mobilenetworks/{}/slices/{}", "2022-11-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.mobile_network_name = AAZStrArg( + options=["--mobile-network-name"], + help="The name of the mobile network.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.slice_name = AAZStrArg( + options=["-n", "--name", "--slice-name"], + help="The name of the network slice.", + required=True, + id_part="child_name_1", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.SlicesGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class SlicesGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/mobileNetworks/{mobileNetworkName}/slices/{sliceName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "mobileNetworkName", self.ctx.args.mobile_network_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "sliceName", self.ctx.args.slice_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.location = AAZStrType( + flags={"required": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType( + flags={"required": True, "client_flatten": True}, + ) + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.description = AAZStrType() + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.snssai = AAZObjectType( + flags={"required": True}, + ) + + snssai = cls._schema_on_200.properties.snssai + snssai.sd = AAZStrType() + snssai.sst = AAZIntType( + flags={"required": True}, + ) + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _ShowHelper: + """Helper class for Show""" + + +__all__ = ["Show"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/slice/_update.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/slice/_update.py new file mode 100644 index 00000000000..b9553426c17 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/slice/_update.py @@ -0,0 +1,483 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network slice update", +) +class Update(AAZCommand): + """Update a network slice. + + :example: Update slie tags + az mobile-network slice update --mobile-network-name mobile-network-name -n slice-name -g rg --tags "{tag:test,tag2:test2}" + """ + + _aaz_info = { + "version": "2022-11-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/mobilenetworks/{}/slices/{}", "2022-11-01"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + AZ_SUPPORT_GENERIC_UPDATE = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, self._output) + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.mobile_network_name = AAZStrArg( + options=["--mobile-network-name"], + help="The name of the mobile network.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.slice_name = AAZStrArg( + options=["-n", "--name", "--slice-name"], + help="The name of the network slice.", + required=True, + id_part="child_name_1", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + + # define Arg Group "Parameters" + + _args_schema = cls._args_schema + _args_schema.tags = AAZDictArg( + options=["--tags"], + arg_group="Parameters", + help="Resource tags.", + nullable=True, + ) + + tags = cls._args_schema.tags + tags.Element = AAZStrArg( + nullable=True, + ) + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.description = AAZStrArg( + options=["--description"], + arg_group="Properties", + help="An optional description for this network slice.", + nullable=True, + ) + _args_schema.snssai = AAZObjectArg( + options=["--snssai"], + arg_group="Properties", + help="Single-network slice selection assistance information (S-NSSAI). Unique at the scope of a mobile network.", + ) + + snssai = cls._args_schema.snssai + snssai.sd = AAZStrArg( + options=["sd"], + help="Slice differentiator (SD).", + nullable=True, + fmt=AAZStrArgFormat( + pattern="^[A-Fa-f0-9]{6}$", + ), + ) + snssai.sst = AAZIntArg( + options=["sst"], + help="Slice/service type (SST).", + fmt=AAZIntArgFormat( + maximum=255, + minimum=0, + ), + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.SlicesGet(ctx=self.ctx)() + self.pre_instance_update(self.ctx.vars.instance) + self.InstanceUpdateByJson(ctx=self.ctx)() + self.InstanceUpdateByGeneric(ctx=self.ctx)() + self.post_instance_update(self.ctx.vars.instance) + yield self.SlicesCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + @register_callback + def pre_instance_update(self, instance): + pass + + @register_callback + def post_instance_update(self, instance): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class SlicesGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/mobileNetworks/{mobileNetworkName}/slices/{sliceName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "mobileNetworkName", self.ctx.args.mobile_network_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "sliceName", self.ctx.args.slice_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + _UpdateHelper._build_schema_slice_read(cls._schema_on_200) + + return cls._schema_on_200 + + class SlicesCreateOrUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200, 201]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/mobileNetworks/{mobileNetworkName}/slices/{sliceName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "mobileNetworkName", self.ctx.args.mobile_network_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "sliceName", self.ctx.args.slice_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + value=self.ctx.vars.instance, + ) + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + _UpdateHelper._build_schema_slice_read(cls._schema_on_200_201) + + return cls._schema_on_200_201 + + class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): + + def __call__(self, *args, **kwargs): + self._update_instance(self.ctx.vars.instance) + + def _update_instance(self, instance): + _instance_value, _builder = self.new_content_builder( + self.ctx.args, + value=instance, + typ=AAZObjectType + ) + _builder.set_prop("properties", AAZObjectType, ".", typ_kwargs={"flags": {"required": True, "client_flatten": True}}) + _builder.set_prop("tags", AAZDictType, ".tags") + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("description", AAZStrType, ".description") + properties.set_prop("snssai", AAZObjectType, ".snssai", typ_kwargs={"flags": {"required": True}}) + + snssai = _builder.get(".properties.snssai") + if snssai is not None: + snssai.set_prop("sd", AAZStrType, ".sd") + snssai.set_prop("sst", AAZIntType, ".sst", typ_kwargs={"flags": {"required": True}}) + + tags = _builder.get(".tags") + if tags is not None: + tags.set_elements(AAZStrType, ".") + + return _instance_value + + class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): + + def __call__(self, *args, **kwargs): + self._update_instance_by_generic( + self.ctx.vars.instance, + self.ctx.generic_update_args + ) + + +class _UpdateHelper: + """Helper class for Update""" + + _schema_slice_read = None + + @classmethod + def _build_schema_slice_read(cls, _schema): + if cls._schema_slice_read is not None: + _schema.id = cls._schema_slice_read.id + _schema.location = cls._schema_slice_read.location + _schema.name = cls._schema_slice_read.name + _schema.properties = cls._schema_slice_read.properties + _schema.system_data = cls._schema_slice_read.system_data + _schema.tags = cls._schema_slice_read.tags + _schema.type = cls._schema_slice_read.type + return + + cls._schema_slice_read = _schema_slice_read = AAZObjectType() + + slice_read = _schema_slice_read + slice_read.id = AAZStrType( + flags={"read_only": True}, + ) + slice_read.location = AAZStrType( + flags={"required": True}, + ) + slice_read.name = AAZStrType( + flags={"read_only": True}, + ) + slice_read.properties = AAZObjectType( + flags={"required": True, "client_flatten": True}, + ) + slice_read.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + slice_read.tags = AAZDictType() + slice_read.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = _schema_slice_read.properties + properties.description = AAZStrType() + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.snssai = AAZObjectType( + flags={"required": True}, + ) + + snssai = _schema_slice_read.properties.snssai + snssai.sd = AAZStrType() + snssai.sst = AAZIntType( + flags={"required": True}, + ) + + system_data = _schema_slice_read.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = _schema_slice_read.tags + tags.Element = AAZStrType() + + _schema.id = cls._schema_slice_read.id + _schema.location = cls._schema_slice_read.location + _schema.name = cls._schema_slice_read.name + _schema.properties = cls._schema_slice_read.properties + _schema.system_data = cls._schema_slice_read.system_data + _schema.tags = cls._schema_slice_read.tags + _schema.type = cls._schema_slice_read.type + + +__all__ = ["Update"] diff --git a/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/slice/_wait.py b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/slice/_wait.py new file mode 100644 index 00000000000..30e83a2361f --- /dev/null +++ b/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/slice/_wait.py @@ -0,0 +1,237 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "mobile-network slice wait", +) +class Wait(AAZWaitCommand): + """Place the CLI in a waiting state until a condition is met. + """ + + _aaz_info = { + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.mobilenetwork/mobilenetworks/{}/slices/{}", "2022-11-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.mobile_network_name = AAZStrArg( + options=["--mobile-network-name"], + help="The name of the mobile network.", + required=True, + id_part="name", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.slice_name = AAZStrArg( + options=["-n", "--name", "--slice-name"], + help="The name of the network slice.", + required=True, + id_part="child_name_1", + fmt=AAZStrArgFormat( + pattern="^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + max_length=64, + ), + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.SlicesGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) + return result + + class SlicesGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/mobileNetworks/{mobileNetworkName}/slices/{sliceName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "MgmtErrorFormat" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "mobileNetworkName", self.ctx.args.mobile_network_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "sliceName", self.ctx.args.slice_name, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2022-11-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.location = AAZStrType( + flags={"required": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType( + flags={"required": True, "client_flatten": True}, + ) + _schema_on_200.system_data = AAZObjectType( + serialized_name="systemData", + flags={"read_only": True}, + ) + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.description = AAZStrType() + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.snssai = AAZObjectType( + flags={"required": True}, + ) + + snssai = cls._schema_on_200.properties.snssai + snssai.sd = AAZStrType() + snssai.sst = AAZIntType( + flags={"required": True}, + ) + + system_data = cls._schema_on_200.system_data + system_data.created_at = AAZStrType( + serialized_name="createdAt", + ) + system_data.created_by = AAZStrType( + serialized_name="createdBy", + ) + system_data.created_by_type = AAZStrType( + serialized_name="createdByType", + ) + system_data.last_modified_at = AAZStrType( + serialized_name="lastModifiedAt", + ) + system_data.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + ) + system_data.last_modified_by_type = AAZStrType( + serialized_name="lastModifiedByType", + ) + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +class _WaitHelper: + """Helper class for Wait""" + + +__all__ = ["Wait"] diff --git a/src/mobile-network/azext_mobile_network/azext_metadata.json b/src/mobile-network/azext_mobile_network/azext_metadata.json new file mode 100644 index 00000000000..1acdf060eb7 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/azext_metadata.json @@ -0,0 +1,4 @@ +{ + "azext.isPreview": true, + "azext.minCliCoreVersion": "2.43.0" +} \ No newline at end of file diff --git a/src/mobile-network/azext_mobile_network/commands.py b/src/mobile-network/azext_mobile_network/commands.py new file mode 100644 index 00000000000..b0d842e4993 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/commands.py @@ -0,0 +1,15 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: disable=too-many-lines +# pylint: disable=too-many-statements + +# from azure.cli.core.commands import CliCommandType + + +def load_command_table(self, _): # pylint: disable=unused-argument + pass diff --git a/src/mobile-network/azext_mobile_network/custom.py b/src/mobile-network/azext_mobile_network/custom.py new file mode 100644 index 00000000000..86df1e48ef5 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/custom.py @@ -0,0 +1,14 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: disable=too-many-lines +# pylint: disable=too-many-statements + +from knack.log import get_logger + + +logger = get_logger(__name__) diff --git a/src/mobile-network/azext_mobile_network/tests/__init__.py b/src/mobile-network/azext_mobile_network/tests/__init__.py new file mode 100644 index 00000000000..5757aea3175 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/tests/__init__.py @@ -0,0 +1,6 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- diff --git a/src/mobile-network/azext_mobile_network/tests/latest/__init__.py b/src/mobile-network/azext_mobile_network/tests/latest/__init__.py new file mode 100644 index 00000000000..5757aea3175 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/tests/latest/__init__.py @@ -0,0 +1,6 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- diff --git a/src/mobile-network/azext_mobile_network/tests/latest/recordings/test_mobile_network.yaml b/src/mobile-network/azext_mobile_network/tests/latest/recordings/test_mobile_network.yaml new file mode 100644 index 00000000000..3cbbd1d6ee3 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/tests/latest/recordings/test_mobile_network.yaml @@ -0,0 +1,299 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network create + Connection: + - keep-alive + ParameterSetName: + - -n -g --identifier + User-Agent: + - AZURECLI/2.43.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_mobile_network000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001","name":"cli_test_mobile_network000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2023-01-03T02:37:21Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '336' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 03 Jan 2023 02:37:26 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus", "properties": {"publicLandMobileNetworkIdentifier": + {"mcc": "001", "mnc": "01"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network create + Connection: + - keep-alive + Content-Length: + - '104' + Content-Type: + - application/json + ParameterSetName: + - -n -g --identifier + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002","name":"mobile_network_000002","type":"microsoft.mobilenetwork/mobilenetworks","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-03T02:37:30.7698985Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-03T02:37:30.7698985Z"},"properties":{"provisioningState":"Succeeded","publicLandMobileNetworkIdentifier":{"mcc":"001","mnc":"01"},"serviceKey":"fb7415fc-b504-4320-95db-476787189578"}}' + headers: + cache-control: + - no-cache + content-length: + - '679' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 03 Jan 2023 02:37:32 GMT + etag: + - '"8200e9fb-0000-0100-0000-63b394ec0000"' + expires: + - '-1' + mise-correlation-id: + - 8777e300-8494-4cce-8742-c4d63d727921 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.1 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: '{"tags": {"tag": "test", "tag2": "test2"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network update + Connection: + - keep-alive + Content-Length: + - '42' + Content-Type: + - application/json + ParameterSetName: + - -n -g --tags + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: PATCH + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002","name":"mobile_network_000002","type":"microsoft.mobilenetwork/mobilenetworks","location":"eastus","tags":{"tag":"test","tag2":"test2"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-03T02:37:30.7698985Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-03T02:37:35.3927139Z"},"properties":{"provisioningState":"Succeeded","publicLandMobileNetworkIdentifier":{"mcc":"001","mnc":"01"},"serviceKey":"fb7415fc-b504-4320-95db-476787189578"}}' + headers: + cache-control: + - no-cache + content-length: + - '716' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 03 Jan 2023 02:37:38 GMT + etag: + - '"820000fc-0000-0100-0000-63b394f00000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network list + Connection: + - keep-alive + ParameterSetName: + - -g + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks?api-version=2022-11-01 + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002","name":"mobile_network_000002","type":"microsoft.mobilenetwork/mobilenetworks","location":"eastus","tags":{"tag":"test","tag2":"test2"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-03T02:37:30.7698985Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-03T02:37:35.3927139Z"},"properties":{"provisioningState":"Succeeded","publicLandMobileNetworkIdentifier":{"mcc":"001","mnc":"01"},"serviceKey":"fb7415fc-b504-4320-95db-476787189578"}}]}' + headers: + cache-control: + - no-cache + content-length: + - '728' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 03 Jan 2023 02:37:41 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-original-request-ids: + - 5fa653a2-32f2-48cc-a9e7-cd8438ae9a3b + - 1e6098a8-f9bc-41b4-9cd4-076021473d3f + - 73881825-29e2-4645-81bb-29a3679ea9da + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network show + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002","name":"mobile_network_000002","type":"microsoft.mobilenetwork/mobilenetworks","location":"eastus","tags":{"tag":"test","tag2":"test2"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-03T02:37:30.7698985Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-03T02:37:35.3927139Z"},"properties":{"provisioningState":"Succeeded","publicLandMobileNetworkIdentifier":{"mcc":"001","mnc":"01"},"serviceKey":"fb7415fc-b504-4320-95db-476787189578"}}' + headers: + cache-control: + - no-cache + content-length: + - '716' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 03 Jan 2023 02:37:42 GMT + etag: + - '"820000fc-0000-0100-0000-63b394f00000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -n -g -y + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002?api-version=2022-11-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Tue, 03 Jan 2023 02:37:47 GMT + expires: + - '-1' + mise-correlation-id: + - 8d3b8113-7646-4f42-a609-04088e22735b + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.1 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 200 + message: OK +version: 1 diff --git a/src/mobile-network/azext_mobile_network/tests/latest/recordings/test_mobile_network_attached_data_network.yaml b/src/mobile-network/azext_mobile_network/tests/latest/recordings/test_mobile_network_attached_data_network.yaml new file mode 100644 index 00000000000..ca1683aa393 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/tests/latest/recordings/test_mobile_network_attached_data_network.yaml @@ -0,0 +1,1825 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network create + Connection: + - keep-alive + ParameterSetName: + - -n -g --identifier + User-Agent: + - AZURECLI/2.43.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_mobile_network000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001","name":"cli_test_mobile_network000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2023-01-05T07:57:14Z","StorageType":"Standard_LRS","type":"test"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '379' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 07:57:25 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus", "properties": {"publicLandMobileNetworkIdentifier": + {"mcc": "001", "mnc": "01"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network create + Connection: + - keep-alive + Content-Length: + - '104' + Content-Type: + - application/json + ParameterSetName: + - -n -g --identifier + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002","name":"mobile_network_000002","type":"microsoft.mobilenetwork/mobilenetworks","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-05T07:57:30.5296389Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-05T07:57:30.5296389Z"},"properties":{"provisioningState":"Succeeded","publicLandMobileNetworkIdentifier":{"mcc":"001","mnc":"01"},"serviceKey":"181cb935-4766-4ca9-aff1-833e9efa7fea"}}' + headers: + cache-control: + - no-cache + content-length: + - '679' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 07:57:32 GMT + etag: + - '"9d002ee3-0000-0100-0000-63b682eb0000"' + expires: + - '-1' + mise-correlation-id: + - 3d37455d-edff-41b4-a215-4ed83418ea35 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.1 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network site create + Connection: + - keep-alive + ParameterSetName: + - --mobile-network-name -n -g + User-Agent: + - AZURECLI/2.43.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_mobile_network000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001","name":"cli_test_mobile_network000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2023-01-05T07:57:14Z","StorageType":"Standard_LRS","type":"test"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '379' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 07:57:33 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network site create + Connection: + - keep-alive + Content-Length: + - '22' + Content-Type: + - application/json + ParameterSetName: + - --mobile-network-name -n -g + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/sites/site_000003?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/sites/site_000003","name":"site_000003","type":"microsoft.mobilenetwork/mobilenetworks/sites","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-05T07:57:37.2333504Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-05T07:57:37.2333504Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '580' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 07:57:38 GMT + etag: + - '"1e0112da-0000-0100-0000-63b682f20000"' + expires: + - '-1' + mise-correlation-id: + - 676bfd36-7684-4fd0-9b34-2483d18064e5 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.1 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1197' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network pccp create + Connection: + - keep-alive + ParameterSetName: + - -n -g --access-interface --local-diagnostics --platform --sites --sku + User-Agent: + - AZURECLI/2.43.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_mobile_network000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001","name":"cli_test_mobile_network000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2023-01-05T07:57:14Z","StorageType":"Standard_LRS","type":"test"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '379' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 07:57:39 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus", "properties": {"controlPlaneAccessInterface": {"ipv4Address": + "10.28.128.2", "ipv4Gateway": "10.28.128.1", "ipv4Subnet": "10.28.128.0/24", + "name": "N2"}, "coreNetworkTechnology": "5GC", "localDiagnosticsAccess": {"authenticationType": + "AAD"}, "platform": {"type": "AKS-HCI"}, "sites": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/sites/site_000003"}], + "sku": "G0", "ueMtu": 1440}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network pccp create + Connection: + - keep-alive + Content-Length: + - '535' + Content-Type: + - application/json + ParameterSetName: + - -n -g --access-interface --local-diagnostics --platform --sites --sku + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp000004?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp000004","name":"pccp000004","type":"microsoft.mobilenetwork/packetcorecontrolplanes","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-05T07:57:44.8183457Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-05T07:57:44.8183457Z"},"properties":{"controlPlaneAccessInterface":{"ipv4Address":"10.28.128.2","ipv4Gateway":"10.28.128.1","ipv4Subnet":"10.28.128.0/24","name":"N2"},"coreNetworkTechnology":"5GC","localDiagnosticsAccess":{"authenticationType":"AAD"},"platform":{"type":"AKS-HCI"},"sites":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/sites/site_000003"}],"sku":"G0","ueMtu":1440,"provisioningState":"Accepted"}}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/2a6f5241-5f14-4e38-8166-0a03573e349f*77AECCCD2D0CF5B287267BD55A2FF6521E9ADFBDEA284DD6ACC331B1CBA4F604?api-version=2022-11-01 + cache-control: + - no-cache + content-length: + - '1034' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 07:57:48 GMT + etag: + - '"4d01fdcc-0000-0100-0000-63b682fb0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.1 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network pccp create + Connection: + - keep-alive + ParameterSetName: + - -n -g --access-interface --local-diagnostics --platform --sites --sku + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/2a6f5241-5f14-4e38-8166-0a03573e349f*77AECCCD2D0CF5B287267BD55A2FF6521E9ADFBDEA284DD6ACC331B1CBA4F604?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/2a6f5241-5f14-4e38-8166-0a03573e349f*77AECCCD2D0CF5B287267BD55A2FF6521E9ADFBDEA284DD6ACC331B1CBA4F604","name":"2a6f5241-5f14-4e38-8166-0a03573e349f*77AECCCD2D0CF5B287267BD55A2FF6521E9ADFBDEA284DD6ACC331B1CBA4F604","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp000004","status":"Accepted","startTime":"2023-01-05T07:57:46.8856644Z"}' + headers: + cache-control: + - no-cache + content-length: + - '535' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 07:58:18 GMT + etag: + - '"9d00356e-0000-0100-0000-63b682fa0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network pccp create + Connection: + - keep-alive + ParameterSetName: + - -n -g --access-interface --local-diagnostics --platform --sites --sku + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/2a6f5241-5f14-4e38-8166-0a03573e349f*77AECCCD2D0CF5B287267BD55A2FF6521E9ADFBDEA284DD6ACC331B1CBA4F604?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/2a6f5241-5f14-4e38-8166-0a03573e349f*77AECCCD2D0CF5B287267BD55A2FF6521E9ADFBDEA284DD6ACC331B1CBA4F604","name":"2a6f5241-5f14-4e38-8166-0a03573e349f*77AECCCD2D0CF5B287267BD55A2FF6521E9ADFBDEA284DD6ACC331B1CBA4F604","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp000004","status":"Accepted","startTime":"2023-01-05T07:57:46.8856644Z"}' + headers: + cache-control: + - no-cache + content-length: + - '535' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 07:58:48 GMT + etag: + - '"9d00356e-0000-0100-0000-63b682fa0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network pccp create + Connection: + - keep-alive + ParameterSetName: + - -n -g --access-interface --local-diagnostics --platform --sites --sku + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/2a6f5241-5f14-4e38-8166-0a03573e349f*77AECCCD2D0CF5B287267BD55A2FF6521E9ADFBDEA284DD6ACC331B1CBA4F604?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/2a6f5241-5f14-4e38-8166-0a03573e349f*77AECCCD2D0CF5B287267BD55A2FF6521E9ADFBDEA284DD6ACC331B1CBA4F604","name":"2a6f5241-5f14-4e38-8166-0a03573e349f*77AECCCD2D0CF5B287267BD55A2FF6521E9ADFBDEA284DD6ACC331B1CBA4F604","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp000004","status":"Succeeded","startTime":"2023-01-05T07:57:46.8856644Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - '554' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 07:59:18 GMT + etag: + - '"14008629-0000-0600-0000-63b6833e0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network pccp create + Connection: + - keep-alive + ParameterSetName: + - -n -g --access-interface --local-diagnostics --platform --sites --sku + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp000004?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp000004","name":"pccp000004","type":"microsoft.mobilenetwork/packetcorecontrolplanes","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-05T07:57:44.8183457Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-05T07:57:44.8183457Z"},"properties":{"provisioningState":"Succeeded","sites":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/sites/site_000003"}],"platform":{"type":"AKS-HCI"},"coreNetworkTechnology":"5GC","controlPlaneAccessInterface":{"name":"N2","ipv4Address":"10.28.128.2","ipv4Subnet":"10.28.128.0/24","ipv4Gateway":"10.28.128.1"},"sku":"G0","ueMtu":1440,"localDiagnosticsAccess":{"authenticationType":"AAD"}}}' + headers: + cache-control: + - no-cache + content-length: + - '1035' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 07:59:19 GMT + etag: + - '"4d0120cd-0000-0100-0000-63b683040000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.1 + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network pcdp create + Connection: + - keep-alive + ParameterSetName: + - -n -g --pccp-name --access-interface + User-Agent: + - AZURECLI/2.43.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_mobile_network000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001","name":"cli_test_mobile_network000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2023-01-05T07:57:14Z","StorageType":"Standard_LRS","type":"test"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '379' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 07:59:19 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus", "properties": {"userPlaneAccessInterface": {"ipv4Address": + "10.28.128.2", "ipv4Gateway": "10.28.128.1", "ipv4Subnet": "10.28.128.0/24", + "name": "N2"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network pcdp create + Connection: + - keep-alive + Content-Length: + - '174' + Content-Type: + - application/json + ParameterSetName: + - -n -g --pccp-name --access-interface + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp000004/packetCoreDataPlanes/pcdp000005?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp000004/packetCoreDataPlanes/pcdp000005","name":"pcdp000005","type":"microsoft.mobilenetwork/packetcorecontrolplanes/packetcoredataplanes","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-05T07:59:24.0760404Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-05T07:59:24.0760404Z"},"properties":{"userPlaneAccessInterface":{"ipv4Address":"10.28.128.2","ipv4Gateway":"10.28.128.1","ipv4Subnet":"10.28.128.0/24","name":"N2"},"provisioningState":"Accepted"}}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/c62ff57e-b938-4fe8-9567-46183bf368b8*6FD96829EB16803DAC1FD86D8EF53C770FEFF14AA9CEF671986A1A223EC40D91?api-version=2022-11-01 + cache-control: + - no-cache + content-length: + - '741' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 07:59:25 GMT + etag: + - '"1900afd4-0000-0100-0000-63b6835c0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.1 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network pcdp create + Connection: + - keep-alive + ParameterSetName: + - -n -g --pccp-name --access-interface + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/c62ff57e-b938-4fe8-9567-46183bf368b8*6FD96829EB16803DAC1FD86D8EF53C770FEFF14AA9CEF671986A1A223EC40D91?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/c62ff57e-b938-4fe8-9567-46183bf368b8*6FD96829EB16803DAC1FD86D8EF53C770FEFF14AA9CEF671986A1A223EC40D91","name":"c62ff57e-b938-4fe8-9567-46183bf368b8*6FD96829EB16803DAC1FD86D8EF53C770FEFF14AA9CEF671986A1A223EC40D91","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp000004/packetCoreDataPlanes/pcdp000005","status":"Accepted","startTime":"2023-01-05T07:59:24.3958742Z"}' + headers: + cache-control: + - no-cache + content-length: + - '567' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 08:00:15 GMT + etag: + - '"9d00df6f-0000-0100-0000-63b6835c0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network pcdp create + Connection: + - keep-alive + ParameterSetName: + - -n -g --pccp-name --access-interface + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/c62ff57e-b938-4fe8-9567-46183bf368b8*6FD96829EB16803DAC1FD86D8EF53C770FEFF14AA9CEF671986A1A223EC40D91?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/c62ff57e-b938-4fe8-9567-46183bf368b8*6FD96829EB16803DAC1FD86D8EF53C770FEFF14AA9CEF671986A1A223EC40D91","name":"c62ff57e-b938-4fe8-9567-46183bf368b8*6FD96829EB16803DAC1FD86D8EF53C770FEFF14AA9CEF671986A1A223EC40D91","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp000004/packetCoreDataPlanes/pcdp000005","status":"Succeeded","startTime":"2023-01-05T07:59:24.3958742Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - '586' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 08:00:47 GMT + etag: + - '"1400872a-0000-0600-0000-63b683a10000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network pcdp create + Connection: + - keep-alive + ParameterSetName: + - -n -g --pccp-name --access-interface + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp000004/packetCoreDataPlanes/pcdp000005?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp000004/packetCoreDataPlanes/pcdp000005","name":"pcdp000005","type":"microsoft.mobilenetwork/packetcorecontrolplanes/packetcoredataplanes","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-05T07:59:24.0760404Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-05T07:59:24.0760404Z"},"properties":{"userPlaneAccessInterface":{"ipv4Address":"10.28.128.2","ipv4Gateway":"10.28.128.1","ipv4Subnet":"10.28.128.0/24","name":"N2"},"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '742' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 08:00:48 GMT + etag: + - '"1900b6d4-0000-0100-0000-63b683680000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network data-network create + Connection: + - keep-alive + ParameterSetName: + - -n -g --mobile-network-name + User-Agent: + - AZURECLI/2.43.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_mobile_network000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001","name":"cli_test_mobile_network000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2023-01-05T07:57:14Z","StorageType":"Standard_LRS","type":"test"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '379' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 08:00:48 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network data-network create + Connection: + - keep-alive + Content-Length: + - '22' + Content-Type: + - application/json + ParameterSetName: + - -n -g --mobile-network-name + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/dataNetworks/dn000006?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/dataNetworks/dn000006","name":"dn000006","type":"microsoft.mobilenetwork/mobilenetworks/datanetworks","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-05T08:00:54.4957198Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-05T08:00:54.4957198Z"},"properties":{"provisioningState":"Accepted"}}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/c843c711-c178-44a5-8349-34b79edfaf9b*6533B225606A20519BD3DB5630DD7948B9CA989416FAC7C32E3B9CD26625C81E?api-version=2022-11-01 + cache-control: + - no-cache + content-length: + - '587' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 08:00:56 GMT + etag: + - '"24008e4a-0000-0100-0000-63b683b80000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.1 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network data-network create + Connection: + - keep-alive + ParameterSetName: + - -n -g --mobile-network-name + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/c843c711-c178-44a5-8349-34b79edfaf9b*6533B225606A20519BD3DB5630DD7948B9CA989416FAC7C32E3B9CD26625C81E?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/c843c711-c178-44a5-8349-34b79edfaf9b*6533B225606A20519BD3DB5630DD7948B9CA989416FAC7C32E3B9CD26625C81E","name":"c843c711-c178-44a5-8349-34b79edfaf9b*6533B225606A20519BD3DB5630DD7948B9CA989416FAC7C32E3B9CD26625C81E","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/dataNetworks/dn000006","status":"Succeeded","startTime":"2023-01-05T08:00:55.7953131Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - '578' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 08:01:28 GMT + etag: + - '"14008d2a-0000-0600-0000-63b683be0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network data-network create + Connection: + - keep-alive + ParameterSetName: + - -n -g --mobile-network-name + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/dataNetworks/dn000006?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/dataNetworks/dn000006","name":"dn000006","type":"microsoft.mobilenetwork/mobilenetworks/datanetworks","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-05T08:00:54.4957198Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-05T08:00:54.4957198Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '588' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 08:01:29 GMT + etag: + - '"1d00ed03-0000-0600-0000-63b683be0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network attached-data-network create + Connection: + - keep-alive + ParameterSetName: + - -n -g --pccp-name --pcdp-name --dns-addresses --data-interface + User-Agent: + - AZURECLI/2.43.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_mobile_network000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001","name":"cli_test_mobile_network000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2023-01-05T07:57:14Z","StorageType":"Standard_LRS","type":"test"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '379' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 08:01:29 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus", "properties": {"dnsAddresses": ["1.1.1.1"], "userPlaneDataInterface": + {"ipv4Address": "10.28.128.2", "ipv4Gateway": "10.28.128.1", "ipv4Subnet": "10.28.128.0/24", + "name": "N2"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network attached-data-network create + Connection: + - keep-alive + Content-Length: + - '201' + Content-Type: + - application/json + ParameterSetName: + - -n -g --pccp-name --pcdp-name --dns-addresses --data-interface + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp000004/packetCoreDataPlanes/pcdp000005/attachedDataNetworks/dn000006?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp000004/packetCoreDataPlanes/pcdp000005/attachedDataNetworks/dn000006","name":"dn000006","type":"microsoft.mobilenetwork/packetcorecontrolplanes/packetcoredataplanes/attacheddatanetworks","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-05T08:01:34.8597484Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-05T08:01:34.8597484Z"},"properties":{"dnsAddresses":["1.1.1.1"],"userPlaneDataInterface":{"ipv4Address":"10.28.128.2","ipv4Gateway":"10.28.128.1","ipv4Subnet":"10.28.128.0/24","name":"N2"},"provisioningState":"Accepted"}}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/c17637d0-46e2-46d3-baf3-a2d5d70dc751*1D657F73320CA6833F54C07C2B5E78AA8F885AC9DB904C14539E7379CB674CF5?api-version=2022-11-01 + cache-control: + - no-cache + content-length: + - '815' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 08:01:37 GMT + etag: + - '"6e01feae-0000-0100-0000-63b683e00000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.1 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network attached-data-network create + Connection: + - keep-alive + ParameterSetName: + - -n -g --pccp-name --pcdp-name --dns-addresses --data-interface + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/c17637d0-46e2-46d3-baf3-a2d5d70dc751*1D657F73320CA6833F54C07C2B5E78AA8F885AC9DB904C14539E7379CB674CF5?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/c17637d0-46e2-46d3-baf3-a2d5d70dc751*1D657F73320CA6833F54C07C2B5E78AA8F885AC9DB904C14539E7379CB674CF5","name":"c17637d0-46e2-46d3-baf3-a2d5d70dc751*1D657F73320CA6833F54C07C2B5E78AA8F885AC9DB904C14539E7379CB674CF5","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp000004/packetCoreDataPlanes/pcdp000005/attachedDataNetworks/dn000006","status":"Accepted","startTime":"2023-01-05T08:01:36.5247872Z"}' + headers: + cache-control: + - no-cache + content-length: + - '597' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 08:02:08 GMT + etag: + - '"9d00a470-0000-0100-0000-63b683e00000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network attached-data-network create + Connection: + - keep-alive + ParameterSetName: + - -n -g --pccp-name --pcdp-name --dns-addresses --data-interface + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/c17637d0-46e2-46d3-baf3-a2d5d70dc751*1D657F73320CA6833F54C07C2B5E78AA8F885AC9DB904C14539E7379CB674CF5?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/c17637d0-46e2-46d3-baf3-a2d5d70dc751*1D657F73320CA6833F54C07C2B5E78AA8F885AC9DB904C14539E7379CB674CF5","name":"c17637d0-46e2-46d3-baf3-a2d5d70dc751*1D657F73320CA6833F54C07C2B5E78AA8F885AC9DB904C14539E7379CB674CF5","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp000004/packetCoreDataPlanes/pcdp000005/attachedDataNetworks/dn000006","status":"Accepted","startTime":"2023-01-05T08:01:36.5247872Z"}' + headers: + cache-control: + - no-cache + content-length: + - '597' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 08:02:39 GMT + etag: + - '"9d00a470-0000-0100-0000-63b683e00000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network attached-data-network create + Connection: + - keep-alive + ParameterSetName: + - -n -g --pccp-name --pcdp-name --dns-addresses --data-interface + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/c17637d0-46e2-46d3-baf3-a2d5d70dc751*1D657F73320CA6833F54C07C2B5E78AA8F885AC9DB904C14539E7379CB674CF5?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/c17637d0-46e2-46d3-baf3-a2d5d70dc751*1D657F73320CA6833F54C07C2B5E78AA8F885AC9DB904C14539E7379CB674CF5","name":"c17637d0-46e2-46d3-baf3-a2d5d70dc751*1D657F73320CA6833F54C07C2B5E78AA8F885AC9DB904C14539E7379CB674CF5","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp000004/packetCoreDataPlanes/pcdp000005/attachedDataNetworks/dn000006","status":"Succeeded","startTime":"2023-01-05T08:01:36.5247872Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - '616' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 08:03:10 GMT + etag: + - '"1400912a-0000-0600-0000-63b684230000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network attached-data-network create + Connection: + - keep-alive + ParameterSetName: + - -n -g --pccp-name --pcdp-name --dns-addresses --data-interface + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp000004/packetCoreDataPlanes/pcdp000005/attachedDataNetworks/dn000006?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp000004/packetCoreDataPlanes/pcdp000005/attachedDataNetworks/dn000006","name":"dn000006","type":"microsoft.mobilenetwork/packetcorecontrolplanes/packetcoredataplanes/attacheddatanetworks","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-05T08:01:34.8597484Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-05T08:01:34.8597484Z"},"properties":{"provisioningState":"Succeeded","userPlaneDataInterface":{"name":"N2","ipv4Address":"10.28.128.2","ipv4Subnet":"10.28.128.0/24","ipv4Gateway":"10.28.128.1"},"dnsAddresses":["1.1.1.1"]}}' + headers: + cache-control: + - no-cache + content-length: + - '816' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 08:03:11 GMT + etag: + - '"6e01e3af-0000-0100-0000-63b683ee0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.1 + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network attached-data-network update + Connection: + - keep-alive + ParameterSetName: + - -n -g --pccp-name --pcdp-name --tags + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp000004/packetCoreDataPlanes/pcdp000005/attachedDataNetworks/dn000006?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp000004/packetCoreDataPlanes/pcdp000005/attachedDataNetworks/dn000006","name":"dn000006","type":"microsoft.mobilenetwork/packetcorecontrolplanes/packetcoredataplanes/attacheddatanetworks","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-05T08:01:34.8597484Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-05T08:01:34.8597484Z"},"properties":{"provisioningState":"Succeeded","userPlaneDataInterface":{"name":"N2","ipv4Address":"10.28.128.2","ipv4Subnet":"10.28.128.0/24","ipv4Gateway":"10.28.128.1"},"dnsAddresses":["1.1.1.1"]}}' + headers: + cache-control: + - no-cache + content-length: + - '816' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 08:03:13 GMT + etag: + - '"6e01e3af-0000-0100-0000-63b683ee0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.1 + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus", "properties": {"dnsAddresses": ["1.1.1.1"], "userPlaneDataInterface": + {"ipv4Address": "10.28.128.2", "ipv4Gateway": "10.28.128.1", "ipv4Subnet": "10.28.128.0/24", + "name": "N2"}}, "tags": {"tag": "test", "tag2": "test2"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network attached-data-network update + Connection: + - keep-alive + Content-Length: + - '243' + Content-Type: + - application/json + ParameterSetName: + - -n -g --pccp-name --pcdp-name --tags + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp000004/packetCoreDataPlanes/pcdp000005/attachedDataNetworks/dn000006?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp000004/packetCoreDataPlanes/pcdp000005/attachedDataNetworks/dn000006","name":"dn000006","type":"microsoft.mobilenetwork/packetcorecontrolplanes/packetcoredataplanes/attacheddatanetworks","location":"eastus","tags":{"tag":"test","tag2":"test2"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-05T08:01:34.8597484Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-05T08:03:13.7861149Z"},"properties":{"provisioningState":"Accepted","dnsAddresses":["1.1.1.1"],"userPlaneDataInterface":{"ipv4Address":"10.28.128.2","ipv4Gateway":"10.28.128.1","ipv4Subnet":"10.28.128.0/24","name":"N2"}}}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/b1517833-0b52-4d12-b8b5-9602380641dc*1D657F73320CA6833F54C07C2B5E78AA8F885AC9DB904C14539E7379CB674CF5?api-version=2022-11-01 + cache-control: + - no-cache + content-length: + - '852' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 08:03:16 GMT + etag: + - '"6e0126b8-0000-0100-0000-63b684420000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.1 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network attached-data-network update + Connection: + - keep-alive + ParameterSetName: + - -n -g --pccp-name --pcdp-name --tags + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/b1517833-0b52-4d12-b8b5-9602380641dc*1D657F73320CA6833F54C07C2B5E78AA8F885AC9DB904C14539E7379CB674CF5?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/b1517833-0b52-4d12-b8b5-9602380641dc*1D657F73320CA6833F54C07C2B5E78AA8F885AC9DB904C14539E7379CB674CF5","name":"b1517833-0b52-4d12-b8b5-9602380641dc*1D657F73320CA6833F54C07C2B5E78AA8F885AC9DB904C14539E7379CB674CF5","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp000004/packetCoreDataPlanes/pcdp000005/attachedDataNetworks/dn000006","status":"Accepted","startTime":"2023-01-05T08:03:14.40152Z"}' + headers: + cache-control: + - no-cache + content-length: + - '595' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 08:03:47 GMT + etag: + - '"9d00d170-0000-0100-0000-63b684420000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network attached-data-network update + Connection: + - keep-alive + ParameterSetName: + - -n -g --pccp-name --pcdp-name --tags + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/b1517833-0b52-4d12-b8b5-9602380641dc*1D657F73320CA6833F54C07C2B5E78AA8F885AC9DB904C14539E7379CB674CF5?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/b1517833-0b52-4d12-b8b5-9602380641dc*1D657F73320CA6833F54C07C2B5E78AA8F885AC9DB904C14539E7379CB674CF5","name":"b1517833-0b52-4d12-b8b5-9602380641dc*1D657F73320CA6833F54C07C2B5E78AA8F885AC9DB904C14539E7379CB674CF5","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp000004/packetCoreDataPlanes/pcdp000005/attachedDataNetworks/dn000006","status":"Accepted","startTime":"2023-01-05T08:03:14.40152Z"}' + headers: + cache-control: + - no-cache + content-length: + - '595' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 08:04:18 GMT + etag: + - '"9d00d170-0000-0100-0000-63b684420000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network attached-data-network update + Connection: + - keep-alive + ParameterSetName: + - -n -g --pccp-name --pcdp-name --tags + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/b1517833-0b52-4d12-b8b5-9602380641dc*1D657F73320CA6833F54C07C2B5E78AA8F885AC9DB904C14539E7379CB674CF5?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/b1517833-0b52-4d12-b8b5-9602380641dc*1D657F73320CA6833F54C07C2B5E78AA8F885AC9DB904C14539E7379CB674CF5","name":"b1517833-0b52-4d12-b8b5-9602380641dc*1D657F73320CA6833F54C07C2B5E78AA8F885AC9DB904C14539E7379CB674CF5","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp000004/packetCoreDataPlanes/pcdp000005/attachedDataNetworks/dn000006","status":"Succeeded","startTime":"2023-01-05T08:03:14.40152Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - '614' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 08:04:49 GMT + etag: + - '"1400a12a-0000-0600-0000-63b684850000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network attached-data-network update + Connection: + - keep-alive + ParameterSetName: + - -n -g --pccp-name --pcdp-name --tags + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp000004/packetCoreDataPlanes/pcdp000005/attachedDataNetworks/dn000006?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp000004/packetCoreDataPlanes/pcdp000005/attachedDataNetworks/dn000006","name":"dn000006","type":"microsoft.mobilenetwork/packetcorecontrolplanes/packetcoredataplanes/attacheddatanetworks","location":"eastus","tags":{"tag":"test","tag2":"test2"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-05T08:01:34.8597484Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-05T08:03:13.7861149Z"},"properties":{"provisioningState":"Succeeded","userPlaneDataInterface":{"name":"N2","ipv4Address":"10.28.128.2","ipv4Subnet":"10.28.128.0/24","ipv4Gateway":"10.28.128.1"},"dnsAddresses":["1.1.1.1"]}}' + headers: + cache-control: + - no-cache + content-length: + - '853' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 08:04:50 GMT + etag: + - '"6e0153b9-0000-0100-0000-63b6844d0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.1 + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network attached-data-network list + Connection: + - keep-alive + ParameterSetName: + - -g --pccp-name --pcdp-name + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp000004/packetCoreDataPlanes/pcdp000005/attachedDataNetworks?api-version=2022-11-01 + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp000004/packetCoreDataPlanes/pcdp000005/attachedDataNetworks/dn000006","name":"dn000006","type":"microsoft.mobilenetwork/packetcorecontrolplanes/packetcoredataplanes/attacheddatanetworks","location":"eastus","tags":{"tag":"test","tag2":"test2"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-05T08:01:34.8597484Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-05T08:03:13.7861149Z"},"properties":{"provisioningState":"Succeeded","userPlaneDataInterface":{"name":"N2","ipv4Address":"10.28.128.2","ipv4Subnet":"10.28.128.0/24","ipv4Gateway":"10.28.128.1"},"dnsAddresses":["1.1.1.1"]}}]}' + headers: + cache-control: + - no-cache + content-length: + - '865' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 08:04:51 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-original-request-ids: + - 17b9c58e-b014-4add-973a-0cc87e5b1d4e + - a644d06b-593d-4180-947a-942ab703cf85 + - 82ae713b-9d2d-4e6d-bbf3-2cf88923c0d0 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network attached-data-network show + Connection: + - keep-alive + ParameterSetName: + - -n --pccp-name --pcdp-name -g + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp000004/packetCoreDataPlanes/pcdp000005/attachedDataNetworks/dn000006?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp000004/packetCoreDataPlanes/pcdp000005/attachedDataNetworks/dn000006","name":"dn000006","type":"microsoft.mobilenetwork/packetcorecontrolplanes/packetcoredataplanes/attacheddatanetworks","location":"eastus","tags":{"tag":"test","tag2":"test2"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-05T08:01:34.8597484Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-05T08:03:13.7861149Z"},"properties":{"provisioningState":"Succeeded","userPlaneDataInterface":{"name":"N2","ipv4Address":"10.28.128.2","ipv4Subnet":"10.28.128.0/24","ipv4Gateway":"10.28.128.1"},"dnsAddresses":["1.1.1.1"]}}' + headers: + cache-control: + - no-cache + content-length: + - '853' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 08:04:54 GMT + etag: + - '"6e0153b9-0000-0100-0000-63b6844d0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.1 + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network attached-data-network delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -n --pccp-name --pcdp-name -g -y + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp000004/packetCoreDataPlanes/pcdp000005/attachedDataNetworks/dn000006?api-version=2022-11-01 + response: + body: + string: 'null' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/e799e5c0-1fd6-4ef5-8703-3742aa91ad57*1D657F73320CA6833F54C07C2B5E78AA8F885AC9DB904C14539E7379CB674CF5?api-version=2022-11-01 + cache-control: + - no-cache + content-length: + - '4' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 08:04:57 GMT + etag: + - '"6e018fc2-0000-0100-0000-63b684aa0000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/e799e5c0-1fd6-4ef5-8703-3742aa91ad57*1D657F73320CA6833F54C07C2B5E78AA8F885AC9DB904C14539E7379CB674CF5?api-version=2022-11-01 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.1 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network attached-data-network delete + Connection: + - keep-alive + ParameterSetName: + - -n --pccp-name --pcdp-name -g -y + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/e799e5c0-1fd6-4ef5-8703-3742aa91ad57*1D657F73320CA6833F54C07C2B5E78AA8F885AC9DB904C14539E7379CB674CF5?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/e799e5c0-1fd6-4ef5-8703-3742aa91ad57*1D657F73320CA6833F54C07C2B5E78AA8F885AC9DB904C14539E7379CB674CF5","name":"e799e5c0-1fd6-4ef5-8703-3742aa91ad57*1D657F73320CA6833F54C07C2B5E78AA8F885AC9DB904C14539E7379CB674CF5","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp000004/packetCoreDataPlanes/pcdp000005/attachedDataNetworks/dn000006","status":"Deleting","startTime":"2023-01-05T08:04:57.5747127Z"}' + headers: + cache-control: + - no-cache + content-length: + - '597' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 08:05:28 GMT + etag: + - '"9d00f070-0000-0100-0000-63b684a90000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network attached-data-network delete + Connection: + - keep-alive + ParameterSetName: + - -n --pccp-name --pcdp-name -g -y + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/e799e5c0-1fd6-4ef5-8703-3742aa91ad57*1D657F73320CA6833F54C07C2B5E78AA8F885AC9DB904C14539E7379CB674CF5?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/e799e5c0-1fd6-4ef5-8703-3742aa91ad57*1D657F73320CA6833F54C07C2B5E78AA8F885AC9DB904C14539E7379CB674CF5","name":"e799e5c0-1fd6-4ef5-8703-3742aa91ad57*1D657F73320CA6833F54C07C2B5E78AA8F885AC9DB904C14539E7379CB674CF5","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp000004/packetCoreDataPlanes/pcdp000005/attachedDataNetworks/dn000006","status":"Deleting","startTime":"2023-01-05T08:04:57.5747127Z"}' + headers: + cache-control: + - no-cache + content-length: + - '597' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 08:06:00 GMT + etag: + - '"9d00f070-0000-0100-0000-63b684a90000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network attached-data-network delete + Connection: + - keep-alive + ParameterSetName: + - -n --pccp-name --pcdp-name -g -y + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/e799e5c0-1fd6-4ef5-8703-3742aa91ad57*1D657F73320CA6833F54C07C2B5E78AA8F885AC9DB904C14539E7379CB674CF5?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/e799e5c0-1fd6-4ef5-8703-3742aa91ad57*1D657F73320CA6833F54C07C2B5E78AA8F885AC9DB904C14539E7379CB674CF5","name":"e799e5c0-1fd6-4ef5-8703-3742aa91ad57*1D657F73320CA6833F54C07C2B5E78AA8F885AC9DB904C14539E7379CB674CF5","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp000004/packetCoreDataPlanes/pcdp000005/attachedDataNetworks/dn000006","status":"Succeeded","startTime":"2023-01-05T08:04:57.5747127Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - '616' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 08:06:30 GMT + etag: + - '"9d002b71-0000-0100-0000-63b684ec0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network attached-data-network delete + Connection: + - keep-alive + ParameterSetName: + - -n --pccp-name --pcdp-name -g -y + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/e799e5c0-1fd6-4ef5-8703-3742aa91ad57*1D657F73320CA6833F54C07C2B5E78AA8F885AC9DB904C14539E7379CB674CF5?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/e799e5c0-1fd6-4ef5-8703-3742aa91ad57*1D657F73320CA6833F54C07C2B5E78AA8F885AC9DB904C14539E7379CB674CF5","name":"e799e5c0-1fd6-4ef5-8703-3742aa91ad57*1D657F73320CA6833F54C07C2B5E78AA8F885AC9DB904C14539E7379CB674CF5","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp000004/packetCoreDataPlanes/pcdp000005/attachedDataNetworks/dn000006","status":"Succeeded","startTime":"2023-01-05T08:04:57.5747127Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - '616' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 08:06:31 GMT + etag: + - '"9d002b71-0000-0100-0000-63b684ec0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/src/mobile-network/azext_mobile_network/tests/latest/recordings/test_mobile_network_data_network.yaml b/src/mobile-network/azext_mobile_network/tests/latest/recordings/test_mobile_network_data_network.yaml new file mode 100644 index 00000000000..c7ebd0a4210 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/tests/latest/recordings/test_mobile_network_data_network.yaml @@ -0,0 +1,814 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network create + Connection: + - keep-alive + ParameterSetName: + - -n -g --identifier + User-Agent: + - AZURECLI/2.43.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_mobile_network000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001","name":"cli_test_mobile_network000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2023-01-05T06:53:23Z","StorageType":"Standard_LRS","type":"test"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '379' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 06:53:33 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus", "properties": {"publicLandMobileNetworkIdentifier": + {"mcc": "001", "mnc": "01"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network create + Connection: + - keep-alive + Content-Length: + - '104' + Content-Type: + - application/json + ParameterSetName: + - -n -g --identifier + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002","name":"mobile_network_000002","type":"microsoft.mobilenetwork/mobilenetworks","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-05T06:53:38.3297722Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-05T06:53:38.3297722Z"},"properties":{"provisioningState":"Succeeded","publicLandMobileNetworkIdentifier":{"mcc":"001","mnc":"01"},"serviceKey":"d5e5826b-797a-42fc-b4e5-546e7dc24f9d"}}' + headers: + cache-control: + - no-cache + content-length: + - '679' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 06:53:40 GMT + etag: + - '"9d002778-0000-0100-0000-63b673f30000"' + expires: + - '-1' + mise-correlation-id: + - 9c0bae3a-cd81-47e9-a8b1-a27e1315e65b + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.1 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network data-network create + Connection: + - keep-alive + ParameterSetName: + - -n -g --mobile-network-name + User-Agent: + - AZURECLI/2.43.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_mobile_network000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001","name":"cli_test_mobile_network000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2023-01-05T06:53:23Z","StorageType":"Standard_LRS","type":"test"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '379' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 06:53:41 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network data-network create + Connection: + - keep-alive + Content-Length: + - '22' + Content-Type: + - application/json + ParameterSetName: + - -n -g --mobile-network-name + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/dataNetworks/dn000003?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/dataNetworks/dn000003","name":"dn000003","type":"microsoft.mobilenetwork/mobilenetworks/datanetworks","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-05T06:53:46.8109123Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-05T06:53:46.8109123Z"},"properties":{"provisioningState":"Accepted"}}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/10117781-f574-41b5-8e2d-381f9589d486*4109A3234F4772A6BB2A9523C8AD1BF4272829FE2A916F2EB6808F53BEC372E0?api-version=2022-11-01 + cache-control: + - no-cache + content-length: + - '587' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 06:53:49 GMT + etag: + - '"2300dc36-0000-0100-0000-63b673fc0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.1 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network data-network create + Connection: + - keep-alive + ParameterSetName: + - -n -g --mobile-network-name + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/10117781-f574-41b5-8e2d-381f9589d486*4109A3234F4772A6BB2A9523C8AD1BF4272829FE2A916F2EB6808F53BEC372E0?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/10117781-f574-41b5-8e2d-381f9589d486*4109A3234F4772A6BB2A9523C8AD1BF4272829FE2A916F2EB6808F53BEC372E0","name":"10117781-f574-41b5-8e2d-381f9589d486*4109A3234F4772A6BB2A9523C8AD1BF4272829FE2A916F2EB6808F53BEC372E0","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/dataNetworks/dn000003","status":"Succeeded","startTime":"2023-01-05T06:53:48.0795085Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - '578' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 06:54:20 GMT + etag: + - '"1400bc22-0000-0600-0000-63b674020000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network data-network create + Connection: + - keep-alive + ParameterSetName: + - -n -g --mobile-network-name + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/dataNetworks/dn000003?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/dataNetworks/dn000003","name":"dn000003","type":"microsoft.mobilenetwork/mobilenetworks/datanetworks","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-05T06:53:46.8109123Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-05T06:53:46.8109123Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '588' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 06:54:21 GMT + etag: + - '"1c00eaf1-0000-0600-0000-63b674020000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network data-network update + Connection: + - keep-alive + ParameterSetName: + - -n -g --mobile-network-name --tags + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/dataNetworks/dn000003?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/dataNetworks/dn000003","name":"dn000003","type":"microsoft.mobilenetwork/mobilenetworks/datanetworks","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-05T06:53:46.8109123Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-05T06:53:46.8109123Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '588' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 06:54:23 GMT + etag: + - '"1c00eaf1-0000-0600-0000-63b674020000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus", "properties": {}, "tags": {"tag": "test", "tag2": + "test2"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network data-network update + Connection: + - keep-alive + Content-Length: + - '82' + Content-Type: + - application/json + ParameterSetName: + - -n -g --mobile-network-name --tags + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/dataNetworks/dn000003?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/dataNetworks/dn000003","name":"dn000003","type":"microsoft.mobilenetwork/mobilenetworks/datanetworks","location":"eastus","tags":{"tag":"test","tag2":"test2"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-05T06:53:46.8109123Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-05T06:54:23.9248598Z"},"properties":{"provisioningState":"Accepted"}}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/18435d51-1c18-4839-bcb1-b24b69ebc7cb*4109A3234F4772A6BB2A9523C8AD1BF4272829FE2A916F2EB6808F53BEC372E0?api-version=2022-11-01 + cache-control: + - no-cache + content-length: + - '624' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 06:54:28 GMT + etag: + - '"2300ba38-0000-0100-0000-63b674200000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.1 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network data-network update + Connection: + - keep-alive + ParameterSetName: + - -n -g --mobile-network-name --tags + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/18435d51-1c18-4839-bcb1-b24b69ebc7cb*4109A3234F4772A6BB2A9523C8AD1BF4272829FE2A916F2EB6808F53BEC372E0?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/18435d51-1c18-4839-bcb1-b24b69ebc7cb*4109A3234F4772A6BB2A9523C8AD1BF4272829FE2A916F2EB6808F53BEC372E0","name":"18435d51-1c18-4839-bcb1-b24b69ebc7cb*4109A3234F4772A6BB2A9523C8AD1BF4272829FE2A916F2EB6808F53BEC372E0","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/dataNetworks/dn000003","status":"Succeeded","startTime":"2023-01-05T06:54:24.2271162Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - '578' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 06:54:59 GMT + etag: + - '"1400c022-0000-0600-0000-63b674260000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network data-network update + Connection: + - keep-alive + ParameterSetName: + - -n -g --mobile-network-name --tags + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/dataNetworks/dn000003?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/dataNetworks/dn000003","name":"dn000003","type":"microsoft.mobilenetwork/mobilenetworks/datanetworks","location":"eastus","tags":{"tag":"test","tag2":"test2"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-05T06:53:46.8109123Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-05T06:54:23.9248598Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '625' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 06:54:59 GMT + etag: + - '"1c00fcf1-0000-0600-0000-63b674260000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network data-network list + Connection: + - keep-alive + ParameterSetName: + - --mobile-network-name -g + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/dataNetworks?api-version=2022-11-01 + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/dataNetworks/dn000003","name":"dn000003","type":"microsoft.mobilenetwork/mobilenetworks/datanetworks","location":"eastus","tags":{"tag":"test","tag2":"test2"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-05T06:53:46.8109123Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-05T06:54:23.9248598Z"},"properties":{"provisioningState":"Succeeded"}}]}' + headers: + cache-control: + - no-cache + content-length: + - '637' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 06:55:02 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-original-request-ids: + - 45fb3d10-0e8b-451c-a0b7-e4354ca33dcf + - cb5f7b64-4dab-477a-8cd7-f7cc7c2a6a2f + - 7c4d5772-7420-42cc-ab83-d2c52848a10d + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network data-network show + Connection: + - keep-alive + ParameterSetName: + - -n --mobile-network-name -g + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/dataNetworks/dn000003?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/dataNetworks/dn000003","name":"dn000003","type":"microsoft.mobilenetwork/mobilenetworks/datanetworks","location":"eastus","tags":{"tag":"test","tag2":"test2"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-05T06:53:46.8109123Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-05T06:54:23.9248598Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '625' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 06:55:05 GMT + etag: + - '"1c00fcf1-0000-0600-0000-63b674260000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network data-network delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -n --mobile-network-name -g -y + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/dataNetworks/dn000003?api-version=2022-11-01 + response: + body: + string: 'null' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/14ec1fb7-eb23-40b5-bf1f-4fbf51c768b2*4109A3234F4772A6BB2A9523C8AD1BF4272829FE2A916F2EB6808F53BEC372E0?api-version=2022-11-01 + cache-control: + - no-cache + content-length: + - '4' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 06:55:07 GMT + etag: + - '"2300ec3a-0000-0100-0000-63b6744c0000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/14ec1fb7-eb23-40b5-bf1f-4fbf51c768b2*4109A3234F4772A6BB2A9523C8AD1BF4272829FE2A916F2EB6808F53BEC372E0?api-version=2022-11-01 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.1 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network data-network delete + Connection: + - keep-alive + ParameterSetName: + - -n --mobile-network-name -g -y + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/14ec1fb7-eb23-40b5-bf1f-4fbf51c768b2*4109A3234F4772A6BB2A9523C8AD1BF4272829FE2A916F2EB6808F53BEC372E0?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/14ec1fb7-eb23-40b5-bf1f-4fbf51c768b2*4109A3234F4772A6BB2A9523C8AD1BF4272829FE2A916F2EB6808F53BEC372E0","name":"14ec1fb7-eb23-40b5-bf1f-4fbf51c768b2*4109A3234F4772A6BB2A9523C8AD1BF4272829FE2A916F2EB6808F53BEC372E0","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/dataNetworks/dn000003","status":"Deleting","startTime":"2023-01-05T06:55:07.7914157Z"}' + headers: + cache-control: + - no-cache + content-length: + - '559' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 06:55:39 GMT + etag: + - '"9d002567-0000-0100-0000-63b6744b0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network data-network delete + Connection: + - keep-alive + ParameterSetName: + - -n --mobile-network-name -g -y + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/14ec1fb7-eb23-40b5-bf1f-4fbf51c768b2*4109A3234F4772A6BB2A9523C8AD1BF4272829FE2A916F2EB6808F53BEC372E0?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/14ec1fb7-eb23-40b5-bf1f-4fbf51c768b2*4109A3234F4772A6BB2A9523C8AD1BF4272829FE2A916F2EB6808F53BEC372E0","name":"14ec1fb7-eb23-40b5-bf1f-4fbf51c768b2*4109A3234F4772A6BB2A9523C8AD1BF4272829FE2A916F2EB6808F53BEC372E0","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/dataNetworks/dn000003","status":"Deleting","startTime":"2023-01-05T06:55:07.7914157Z"}' + headers: + cache-control: + - no-cache + content-length: + - '559' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 06:56:08 GMT + etag: + - '"9d002567-0000-0100-0000-63b6744b0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network data-network delete + Connection: + - keep-alive + ParameterSetName: + - -n --mobile-network-name -g -y + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/14ec1fb7-eb23-40b5-bf1f-4fbf51c768b2*4109A3234F4772A6BB2A9523C8AD1BF4272829FE2A916F2EB6808F53BEC372E0?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/14ec1fb7-eb23-40b5-bf1f-4fbf51c768b2*4109A3234F4772A6BB2A9523C8AD1BF4272829FE2A916F2EB6808F53BEC372E0","name":"14ec1fb7-eb23-40b5-bf1f-4fbf51c768b2*4109A3234F4772A6BB2A9523C8AD1BF4272829FE2A916F2EB6808F53BEC372E0","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/dataNetworks/dn000003","status":"Succeeded","startTime":"2023-01-05T06:55:07.7914157Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - '578' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 06:56:39 GMT + etag: + - '"1400c422-0000-0600-0000-63b6748f0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network data-network delete + Connection: + - keep-alive + ParameterSetName: + - -n --mobile-network-name -g -y + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/14ec1fb7-eb23-40b5-bf1f-4fbf51c768b2*4109A3234F4772A6BB2A9523C8AD1BF4272829FE2A916F2EB6808F53BEC372E0?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/14ec1fb7-eb23-40b5-bf1f-4fbf51c768b2*4109A3234F4772A6BB2A9523C8AD1BF4272829FE2A916F2EB6808F53BEC372E0","name":"14ec1fb7-eb23-40b5-bf1f-4fbf51c768b2*4109A3234F4772A6BB2A9523C8AD1BF4272829FE2A916F2EB6808F53BEC372E0","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/dataNetworks/dn000003","status":"Succeeded","startTime":"2023-01-05T06:55:07.7914157Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - '578' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 06:56:39 GMT + etag: + - '"1400c422-0000-0600-0000-63b6748f0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/src/mobile-network/azext_mobile_network/tests/latest/recordings/test_mobile_network_pccp.yaml b/src/mobile-network/azext_mobile_network/tests/latest/recordings/test_mobile_network_pccp.yaml new file mode 100644 index 00000000000..5c49d4d28f9 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/tests/latest/recordings/test_mobile_network_pccp.yaml @@ -0,0 +1,1207 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network create + Connection: + - keep-alive + ParameterSetName: + - -n -g --identifier + User-Agent: + - AZURECLI/2.43.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_mobile_network000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001","name":"cli_test_mobile_network000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2023-01-05T19:27:02Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '336' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 19:27:13 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus", "properties": {"publicLandMobileNetworkIdentifier": + {"mcc": "001", "mnc": "01"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network create + Connection: + - keep-alive + Content-Length: + - '104' + Content-Type: + - application/json + ParameterSetName: + - -n -g --identifier + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002","name":"mobile_network_000002","type":"microsoft.mobilenetwork/mobilenetworks","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-05T19:27:18.5440695Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-05T19:27:18.5440695Z"},"properties":{"provisioningState":"Succeeded","publicLandMobileNetworkIdentifier":{"mcc":"001","mnc":"01"},"serviceKey":"8392852f-350a-4a4c-9baf-6827798f21f3"}}' + headers: + cache-control: + - no-cache + content-length: + - '679' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 19:27:21 GMT + etag: + - '"a4008f93-0000-0100-0000-63b724970000"' + expires: + - '-1' + mise-correlation-id: + - 74f1bf59-8b6f-4c5c-b852-d6d467fd4ca5 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.1 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network site create + Connection: + - keep-alive + ParameterSetName: + - --mobile-network-name -n -g + User-Agent: + - AZURECLI/2.43.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_mobile_network000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001","name":"cli_test_mobile_network000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2023-01-05T19:27:02Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '336' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 19:27:22 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network site create + Connection: + - keep-alive + Content-Length: + - '22' + Content-Type: + - application/json + ParameterSetName: + - --mobile-network-name -n -g + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/sites/site_000003?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/sites/site_000003","name":"site_000003","type":"microsoft.mobilenetwork/mobilenetworks/sites","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-05T19:27:27.7188122Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-05T19:27:27.7188122Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '580' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 19:27:29 GMT + etag: + - '"350173ef-0000-0100-0000-63b724a00000"' + expires: + - '-1' + mise-correlation-id: + - 5a98ddb5-ae2a-4754-a1e9-3aabf0acaed7 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.1 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network pccp create + Connection: + - keep-alive + ParameterSetName: + - -n -g --access-interface --local-diagnostics --platform --sites --sku + User-Agent: + - AZURECLI/2.43.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_mobile_network000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001","name":"cli_test_mobile_network000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2023-01-05T19:27:02Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '336' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 19:27:30 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus", "properties": {"controlPlaneAccessInterface": {"ipv4Address": + "10.28.128.2", "ipv4Gateway": "10.28.128.1", "ipv4Subnet": "10.28.128.0/24", + "name": "N2"}, "coreNetworkTechnology": "5GC", "localDiagnosticsAccess": {"authenticationType": + "AAD"}, "platform": {"type": "AKS-HCI"}, "sites": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/sites/site_000003"}], + "sku": "G0", "ueMtu": 1440}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network pccp create + Connection: + - keep-alive + Content-Length: + - '535' + Content-Type: + - application/json + ParameterSetName: + - -n -g --access-interface --local-diagnostics --platform --sites --sku + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp_000004?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp_000004","name":"pccp_000004","type":"microsoft.mobilenetwork/packetcorecontrolplanes","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-05T19:27:34.8945595Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-05T19:27:34.8945595Z"},"properties":{"controlPlaneAccessInterface":{"ipv4Address":"10.28.128.2","ipv4Gateway":"10.28.128.1","ipv4Subnet":"10.28.128.0/24","name":"N2"},"coreNetworkTechnology":"5GC","localDiagnosticsAccess":{"authenticationType":"AAD"},"platform":{"type":"AKS-HCI"},"sites":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/sites/site_000003"}],"sku":"G0","ueMtu":1440,"provisioningState":"Accepted"}}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/cdc52419-334b-451a-a764-95a9a4e8d6e5*6DBFB789961125AA5985A05064BE25ACE64DCEDFA779600BB77CFA9498DA04E5?api-version=2022-11-01 + cache-control: + - no-cache + content-length: + - '1036' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 19:27:37 GMT + etag: + - '"50019711-0000-0100-0000-63b724a80000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.1 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network pccp create + Connection: + - keep-alive + ParameterSetName: + - -n -g --access-interface --local-diagnostics --platform --sites --sku + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/cdc52419-334b-451a-a764-95a9a4e8d6e5*6DBFB789961125AA5985A05064BE25ACE64DCEDFA779600BB77CFA9498DA04E5?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/cdc52419-334b-451a-a764-95a9a4e8d6e5*6DBFB789961125AA5985A05064BE25ACE64DCEDFA779600BB77CFA9498DA04E5","name":"cdc52419-334b-451a-a764-95a9a4e8d6e5*6DBFB789961125AA5985A05064BE25ACE64DCEDFA779600BB77CFA9498DA04E5","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp_000004","status":"Accepted","startTime":"2023-01-05T19:27:36.3345947Z"}' + headers: + cache-control: + - no-cache + content-length: + - '536' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 19:28:08 GMT + etag: + - '"9e000cd3-0000-0100-0000-63b724a80000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network pccp create + Connection: + - keep-alive + ParameterSetName: + - -n -g --access-interface --local-diagnostics --platform --sites --sku + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/cdc52419-334b-451a-a764-95a9a4e8d6e5*6DBFB789961125AA5985A05064BE25ACE64DCEDFA779600BB77CFA9498DA04E5?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/cdc52419-334b-451a-a764-95a9a4e8d6e5*6DBFB789961125AA5985A05064BE25ACE64DCEDFA779600BB77CFA9498DA04E5","name":"cdc52419-334b-451a-a764-95a9a4e8d6e5*6DBFB789961125AA5985A05064BE25ACE64DCEDFA779600BB77CFA9498DA04E5","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp_000004","status":"Accepted","startTime":"2023-01-05T19:27:36.3345947Z"}' + headers: + cache-control: + - no-cache + content-length: + - '536' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 19:28:38 GMT + etag: + - '"9e000cd3-0000-0100-0000-63b724a80000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network pccp create + Connection: + - keep-alive + ParameterSetName: + - -n -g --access-interface --local-diagnostics --platform --sites --sku + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/cdc52419-334b-451a-a764-95a9a4e8d6e5*6DBFB789961125AA5985A05064BE25ACE64DCEDFA779600BB77CFA9498DA04E5?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/cdc52419-334b-451a-a764-95a9a4e8d6e5*6DBFB789961125AA5985A05064BE25ACE64DCEDFA779600BB77CFA9498DA04E5","name":"cdc52419-334b-451a-a764-95a9a4e8d6e5*6DBFB789961125AA5985A05064BE25ACE64DCEDFA779600BB77CFA9498DA04E5","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp_000004","status":"Succeeded","startTime":"2023-01-05T19:27:36.3345947Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - '555' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 19:29:09 GMT + etag: + - '"1500a393-0000-0600-0000-63b724eb0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network pccp create + Connection: + - keep-alive + ParameterSetName: + - -n -g --access-interface --local-diagnostics --platform --sites --sku + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp_000004?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp_000004","name":"pccp_000004","type":"microsoft.mobilenetwork/packetcorecontrolplanes","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-05T19:27:34.8945595Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-05T19:27:34.8945595Z"},"properties":{"provisioningState":"Succeeded","sites":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/sites/site_000003"}],"platform":{"type":"AKS-HCI"},"coreNetworkTechnology":"5GC","controlPlaneAccessInterface":{"name":"N2","ipv4Address":"10.28.128.2","ipv4Subnet":"10.28.128.0/24","ipv4Gateway":"10.28.128.1"},"sku":"G0","ueMtu":1440,"localDiagnosticsAccess":{"authenticationType":"AAD"}}}' + headers: + cache-control: + - no-cache + content-length: + - '1037' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 19:29:10 GMT + etag: + - '"5001ce11-0000-0100-0000-63b724b20000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.1 + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network pccp update + Connection: + - keep-alive + ParameterSetName: + - -n -g --ue-mtu --tags + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp_000004?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp_000004","name":"pccp_000004","type":"microsoft.mobilenetwork/packetcorecontrolplanes","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-05T19:27:34.8945595Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-05T19:27:34.8945595Z"},"properties":{"provisioningState":"Succeeded","sites":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/sites/site_000003"}],"platform":{"type":"AKS-HCI"},"coreNetworkTechnology":"5GC","controlPlaneAccessInterface":{"name":"N2","ipv4Address":"10.28.128.2","ipv4Subnet":"10.28.128.0/24","ipv4Gateway":"10.28.128.1"},"sku":"G0","ueMtu":1440,"localDiagnosticsAccess":{"authenticationType":"AAD"}}}' + headers: + cache-control: + - no-cache + content-length: + - '1037' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 19:29:11 GMT + etag: + - '"5001ce11-0000-0100-0000-63b724b20000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.1 + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus", "properties": {"controlPlaneAccessInterface": {"ipv4Address": + "10.28.128.2", "ipv4Gateway": "10.28.128.1", "ipv4Subnet": "10.28.128.0/24", + "name": "N2"}, "coreNetworkTechnology": "5GC", "localDiagnosticsAccess": {"authenticationType": + "AAD"}, "platform": {"type": "AKS-HCI"}, "sites": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/sites/site_000003"}], + "sku": "G0", "ueMtu": 1500}, "tags": {"tag": "test", "tag2": "test2"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network pccp update + Connection: + - keep-alive + Content-Length: + - '577' + Content-Type: + - application/json + ParameterSetName: + - -n -g --ue-mtu --tags + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp_000004?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp_000004","name":"pccp_000004","type":"microsoft.mobilenetwork/packetcorecontrolplanes","location":"eastus","tags":{"tag":"test","tag2":"test2"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-05T19:27:34.8945595Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-05T19:29:13.1509098Z"},"properties":{"provisioningState":"Accepted","controlPlaneAccessInterface":{"ipv4Address":"10.28.128.2","ipv4Gateway":"10.28.128.1","ipv4Subnet":"10.28.128.0/24","name":"N2"},"coreNetworkTechnology":"5GC","localDiagnosticsAccess":{"authenticationType":"AAD"},"platform":{"type":"AKS-HCI"},"sites":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/sites/site_000003"}],"sku":"G0","ueMtu":1500}}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/c24b08fe-aa53-485a-aac9-3b493633e6d1*6DBFB789961125AA5985A05064BE25ACE64DCEDFA779600BB77CFA9498DA04E5?api-version=2022-11-01 + cache-control: + - no-cache + content-length: + - '1073' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 19:29:16 GMT + etag: + - '"50011e13-0000-0100-0000-63b7250a0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.1 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network pccp update + Connection: + - keep-alive + ParameterSetName: + - -n -g --ue-mtu --tags + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/c24b08fe-aa53-485a-aac9-3b493633e6d1*6DBFB789961125AA5985A05064BE25ACE64DCEDFA779600BB77CFA9498DA04E5?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/c24b08fe-aa53-485a-aac9-3b493633e6d1*6DBFB789961125AA5985A05064BE25ACE64DCEDFA779600BB77CFA9498DA04E5","name":"c24b08fe-aa53-485a-aac9-3b493633e6d1*6DBFB789961125AA5985A05064BE25ACE64DCEDFA779600BB77CFA9498DA04E5","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp_000004","status":"Accepted","startTime":"2023-01-05T19:29:13.6935552Z"}' + headers: + cache-control: + - no-cache + content-length: + - '536' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 19:29:47 GMT + etag: + - '"9e001fd3-0000-0100-0000-63b725090000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network pccp update + Connection: + - keep-alive + ParameterSetName: + - -n -g --ue-mtu --tags + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/c24b08fe-aa53-485a-aac9-3b493633e6d1*6DBFB789961125AA5985A05064BE25ACE64DCEDFA779600BB77CFA9498DA04E5?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/c24b08fe-aa53-485a-aac9-3b493633e6d1*6DBFB789961125AA5985A05064BE25ACE64DCEDFA779600BB77CFA9498DA04E5","name":"c24b08fe-aa53-485a-aac9-3b493633e6d1*6DBFB789961125AA5985A05064BE25ACE64DCEDFA779600BB77CFA9498DA04E5","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp_000004","status":"Accepted","startTime":"2023-01-05T19:29:13.6935552Z"}' + headers: + cache-control: + - no-cache + content-length: + - '536' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 19:30:18 GMT + etag: + - '"9e001fd3-0000-0100-0000-63b725090000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network pccp update + Connection: + - keep-alive + ParameterSetName: + - -n -g --ue-mtu --tags + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/c24b08fe-aa53-485a-aac9-3b493633e6d1*6DBFB789961125AA5985A05064BE25ACE64DCEDFA779600BB77CFA9498DA04E5?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/c24b08fe-aa53-485a-aac9-3b493633e6d1*6DBFB789961125AA5985A05064BE25ACE64DCEDFA779600BB77CFA9498DA04E5","name":"c24b08fe-aa53-485a-aac9-3b493633e6d1*6DBFB789961125AA5985A05064BE25ACE64DCEDFA779600BB77CFA9498DA04E5","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp_000004","status":"Succeeded","startTime":"2023-01-05T19:29:13.6935552Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - '555' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 19:30:48 GMT + etag: + - '"9e003ad3-0000-0100-0000-63b7254c0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network pccp update + Connection: + - keep-alive + ParameterSetName: + - -n -g --ue-mtu --tags + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp_000004?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp_000004","name":"pccp_000004","type":"microsoft.mobilenetwork/packetcorecontrolplanes","location":"eastus","tags":{"tag":"test","tag2":"test2"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-05T19:27:34.8945595Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-05T19:29:13.1509098Z"},"properties":{"provisioningState":"Succeeded","sites":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/sites/site_000003"}],"platform":{"type":"AKS-HCI"},"coreNetworkTechnology":"5GC","controlPlaneAccessInterface":{"name":"N2","ipv4Address":"10.28.128.2","ipv4Subnet":"10.28.128.0/24","ipv4Gateway":"10.28.128.1"},"sku":"G0","ueMtu":1500,"localDiagnosticsAccess":{"authenticationType":"AAD"}}}' + headers: + cache-control: + - no-cache + content-length: + - '1074' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 19:30:50 GMT + etag: + - '"50012c13-0000-0100-0000-63b725160000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.1 + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network pccp list + Connection: + - keep-alive + ParameterSetName: + - -g + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes?api-version=2022-11-01 + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp_000004","name":"pccp_000004","type":"microsoft.mobilenetwork/packetcorecontrolplanes","location":"eastus","tags":{"tag":"test","tag2":"test2"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-05T19:27:34.8945595Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-05T19:29:13.1509098Z"},"properties":{"provisioningState":"Succeeded","sites":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/sites/site_000003"}],"platform":{"type":"AKS-HCI"},"coreNetworkTechnology":"5GC","controlPlaneAccessInterface":{"name":"N2","ipv4Address":"10.28.128.2","ipv4Subnet":"10.28.128.0/24","ipv4Gateway":"10.28.128.1"},"sku":"G0","ueMtu":1500,"localDiagnosticsAccess":{"authenticationType":"AAD"}}}]}' + headers: + cache-control: + - no-cache + content-length: + - '1086' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 19:31:11 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-original-request-ids: + - '' + - 253e8f7b-70bb-4d5e-b83b-e1b0e5ba4bf6 + - bce14f88-f0f2-4e8f-bc99-65598b1b549f + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network pccp show + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp_000004?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp_000004","name":"pccp_000004","type":"microsoft.mobilenetwork/packetcorecontrolplanes","location":"eastus","tags":{"tag":"test","tag2":"test2"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-05T19:27:34.8945595Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-05T19:29:13.1509098Z"},"properties":{"provisioningState":"Succeeded","sites":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/sites/site_000003"}],"platform":{"type":"AKS-HCI"},"coreNetworkTechnology":"5GC","controlPlaneAccessInterface":{"name":"N2","ipv4Address":"10.28.128.2","ipv4Subnet":"10.28.128.0/24","ipv4Gateway":"10.28.128.1"},"sku":"G0","ueMtu":1500,"localDiagnosticsAccess":{"authenticationType":"AAD"}}}' + headers: + cache-control: + - no-cache + content-length: + - '1074' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 19:31:13 GMT + etag: + - '"50012c13-0000-0100-0000-63b725160000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.1 + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network pccp version list + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions?api-version=2022-11-01 + response: + body: + string: '{"value":[{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/PMN-4-9-0","name":"PMN-4-9-0","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/PMN-4-9-1-rc1","name":"PMN-4-9-1-rc1","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/PMN-4-9-1","name":"PMN-4-9-1","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/PMN-4-9-2","name":"PMN-4-9-2","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/PMN-4-9-3","name":"PMN-4-9-3","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/PMN-4-9-4","name":"PMN-4-9-4","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/PMN-4-10-0-rc1","name":"PMN-4-10-0-rc1","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/PMN-4-11-0-rc1","name":"PMN-4-11-0-rc1","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/PMN-4-11-0-rc2","name":"PMN-4-11-0-rc2","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/PMN-4-11-0-rc3","name":"PMN-4-11-0-rc3","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/PMN-4-11-0-rx3","name":"PMN-4-11-0-rx3","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/PMN-4-11-0-rc4","name":"PMN-4-11-0-rc4","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/PMN-4-11-0-rc5","name":"PMN-4-11-0-rc5","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/PMN-4-11-0-rc6","name":"PMN-4-11-0-rc6","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/PMN-4-11-0","name":"PMN-4-11-0","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/PMN-4-11-1","name":"PMN-4-11-1","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/DevTest","name":"DevTest","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/DevTest-05Apr","name":"DevTest-05Apr","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/zz","name":"zz","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/PMN-4-12-0","name":"PMN-4-12-0","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/PMN-4-13-0-rc2","name":"PMN-4-13-0-rc2","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/PMN-4-13-0-rc3","name":"PMN-4-13-0-rc3","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/pmn-4-13-0-rc5","name":"pmn-4-13-0-rc5","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/pmn-4-13-0-av2","name":"pmn-4-13-0-av2","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/pmn-0-1-0-fix","name":"pmn-0-1-0-fix","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/pmn-7b1cf2","name":"pmn-7b1cf2","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/PMN-4-13-0-rc6","name":"PMN-4-13-0-rc6","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/pmn-4-13-1-av2","name":"pmn-4-13-1-av2","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/PMN-4-13-0-rc7","name":"PMN-4-13-0-rc7","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/pmn-4-12-1","name":"pmn-4-12-1","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/pmn-0-1-4-ta2","name":"pmn-0-1-4-ta2","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/pmn-0-1-5-ta2","name":"pmn-0-1-5-ta2","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/PMN-4-13-1","name":"PMN-4-13-1","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/pmn-0-1-6-ta2","name":"pmn-0-1-6-ta2","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/pmn-4-13-0-av3","name":"pmn-4-13-0-av3","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/pmn-0-1-7-ta2","name":"pmn-0-1-7-ta2","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/pmn-0-0-0","name":"pmn-0-0-0","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/pmn-4-13-2-av","name":"pmn-4-13-2-av","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/pmn-4-14-0-rc1","name":"pmn-4-14-0-rc1","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/pmn-4-14-0-rc4","name":"pmn-4-14-0-rc4","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/pmn-4-14-0-rc5","name":"pmn-4-14-0-rc5","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/pmn-4-14-0-rc6","name":"pmn-4-14-0-rc6","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/pmn-4-14-0-rc7","name":"pmn-4-14-0-rc7","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/pmn-4-15-0-rc1","name":"pmn-4-15-0-rc1","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/pmn-4-15-0-rc2","name":"pmn-4-15-0-rc2","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/pmn-4-15-0-rc3","name":"pmn-4-15-0-rc3","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/pmn-4-15-0","name":"pmn-4-15-0","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/pmn-4-16-0-rc1","name":"pmn-4-16-0-rc1","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/pmn-4-16-0-rc2","name":"pmn-4-16-0-rc2","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/pmn-4-16-0-rc3","name":"pmn-4-16-0-rc3","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/pmn-4-16-0","name":"pmn-4-16-0","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/pmn-4-17-0-rc4","name":"pmn-4-17-0-rc4","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/pmn-4-17-0-rc5","name":"pmn-4-17-0-rc5","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/pmn-4-17-0-rc6","name":"pmn-4-17-0-rc6","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/pmn-4-17-0","name":"pmn-4-17-0","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/pmn-4-17-1-rc1","name":"pmn-4-17-1-rc1","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/pmn-4-17-1","name":"pmn-4-17-1","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/pmn-4-17-2","name":"pmn-4-17-2","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/pmn-4-18-0-rc1","name":"pmn-4-18-0-rc1","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/pmn-2213-0-0","name":"pmn-2213-0-0","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/pmn-2216-0-0","name":"pmn-2216-0-0","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/pmn-4-18-0-rc2","name":"pmn-4-18-0-rc2","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/pmn-2216-0-0-3","name":"pmn-2216-0-0-3","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/pmn-4-99-0-rc1","name":"pmn-4-99-0-rc1","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/pmn-4-99-0","name":"pmn-4-99-0","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/pmn-2211-0-0-2","name":"pmn-2211-0-0-2","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/pmn-4-18-0-rc3","name":"pmn-4-18-0-rc3","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[{"platformType":"AKS-HCI","versionState":"Deprecated","minimumPlatformSoftwareVersion":"2209","maximumPlatformSoftwareVersion":"2212","recommendedVersion":"NotRecommended","obsoleteVersion":"Obsolete"}]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/pmn-4-18-0","name":"pmn-4-18-0","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[{"platformType":"AKS-HCI","versionState":"Active","minimumPlatformSoftwareVersion":"2209","maximumPlatformSoftwareVersion":"2212","recommendedVersion":"NotRecommended","obsoleteVersion":"Obsolete"}]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/pmn-2211-0-1","name":"pmn-2211-0-1","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[{"platformType":"AKS-HCI","versionState":"Preview","minimumPlatformSoftwareVersion":"2211","maximumPlatformSoftwareVersion":"2212","recommendedVersion":"NotRecommended","obsoleteVersion":"NotObsolete"}]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/pmn-2211-0-2","name":"pmn-2211-0-2","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[{"platformType":"AKS-HCI","versionState":"Preview","minimumPlatformSoftwareVersion":"2210","maximumPlatformSoftwareVersion":"2303","recommendedVersion":"NotRecommended","obsoleteVersion":"Obsolete"}]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/pmn-2211-0-3","name":"pmn-2211-0-3","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[{"platformType":"AKS-HCI","versionState":"Active","minimumPlatformSoftwareVersion":"2210","maximumPlatformSoftwareVersion":"2303","recommendedVersion":"Recommended","obsoleteVersion":"NotObsolete"}]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/pmn-1-0-ls51","name":"pmn-1-0-ls51","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[{"platformType":"AKS-HCI","versionState":"Preview","minimumPlatformSoftwareVersion":"2210","maximumPlatformSoftwareVersion":"2303","recommendedVersion":"NotRecommended","obsoleteVersion":"NotObsolete"}]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/pmn-2212-0-2","name":"pmn-2212-0-2","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[{"platformType":"AKS-HCI","versionState":"Preview","minimumPlatformSoftwareVersion":"2210","maximumPlatformSoftwareVersion":"2303","recommendedVersion":"NotRecommended","obsoleteVersion":"NotObsolete"}]}},{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/pmn-2211-0-80","name":"pmn-2211-0-80","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[{"platformType":"AKS-HCI","versionState":"Preview","minimumPlatformSoftwareVersion":"2210","maximumPlatformSoftwareVersion":"2303","recommendedVersion":"NotRecommended","obsoleteVersion":"NotObsolete"}]}}]}' + headers: + cache-control: + - no-cache + content-length: + - '16752' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 19:31:15 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.1 + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network pccp version show + Connection: + - keep-alive + ParameterSetName: + - --version-name + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/pmn-2211-0-80?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/pmn-2211-0-80","name":"pmn-2211-0-80","type":"Microsoft.MobileNetwork/packetCoreControlPlaneVersions","properties":{"platforms":[{"platformType":"AKS-HCI","versionState":"Preview","minimumPlatformSoftwareVersion":"2210","maximumPlatformSoftwareVersion":"2303","recommendedVersion":"NotRecommended","obsoleteVersion":"NotObsolete"}]}}' + headers: + cache-control: + - no-cache + content-length: + - '406' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 19:31:18 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.1 + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network pccp delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -n -g -y + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp_000004?api-version=2022-11-01 + response: + body: + string: 'null' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/2347981f-f724-4f94-929a-284576d583d9*6DBFB789961125AA5985A05064BE25ACE64DCEDFA779600BB77CFA9498DA04E5?api-version=2022-11-01 + cache-control: + - no-cache + content-length: + - '4' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 19:31:21 GMT + etag: + - '"50010e15-0000-0100-0000-63b725890000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/2347981f-f724-4f94-929a-284576d583d9*6DBFB789961125AA5985A05064BE25ACE64DCEDFA779600BB77CFA9498DA04E5?api-version=2022-11-01 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.1 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network pccp delete + Connection: + - keep-alive + ParameterSetName: + - -n -g -y + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/2347981f-f724-4f94-929a-284576d583d9*6DBFB789961125AA5985A05064BE25ACE64DCEDFA779600BB77CFA9498DA04E5?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/2347981f-f724-4f94-929a-284576d583d9*6DBFB789961125AA5985A05064BE25ACE64DCEDFA779600BB77CFA9498DA04E5","name":"2347981f-f724-4f94-929a-284576d583d9*6DBFB789961125AA5985A05064BE25ACE64DCEDFA779600BB77CFA9498DA04E5","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp_000004","status":"Deleting","startTime":"2023-01-05T19:31:21.2092085Z"}' + headers: + cache-control: + - no-cache + content-length: + - '536' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 19:31:51 GMT + etag: + - '"9e0056d3-0000-0100-0000-63b725890000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network pccp delete + Connection: + - keep-alive + ParameterSetName: + - -n -g -y + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/2347981f-f724-4f94-929a-284576d583d9*6DBFB789961125AA5985A05064BE25ACE64DCEDFA779600BB77CFA9498DA04E5?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/2347981f-f724-4f94-929a-284576d583d9*6DBFB789961125AA5985A05064BE25ACE64DCEDFA779600BB77CFA9498DA04E5","name":"2347981f-f724-4f94-929a-284576d583d9*6DBFB789961125AA5985A05064BE25ACE64DCEDFA779600BB77CFA9498DA04E5","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp_000004","status":"Deleting","startTime":"2023-01-05T19:31:21.2092085Z"}' + headers: + cache-control: + - no-cache + content-length: + - '536' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 19:32:21 GMT + etag: + - '"9e0056d3-0000-0100-0000-63b725890000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network pccp delete + Connection: + - keep-alive + ParameterSetName: + - -n -g -y + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/2347981f-f724-4f94-929a-284576d583d9*6DBFB789961125AA5985A05064BE25ACE64DCEDFA779600BB77CFA9498DA04E5?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/2347981f-f724-4f94-929a-284576d583d9*6DBFB789961125AA5985A05064BE25ACE64DCEDFA779600BB77CFA9498DA04E5","name":"2347981f-f724-4f94-929a-284576d583d9*6DBFB789961125AA5985A05064BE25ACE64DCEDFA779600BB77CFA9498DA04E5","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp_000004","status":"Succeeded","startTime":"2023-01-05T19:31:21.2092085Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - '555' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 19:32:52 GMT + etag: + - '"9e006ed3-0000-0100-0000-63b725cb0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network pccp delete + Connection: + - keep-alive + ParameterSetName: + - -n -g -y + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/2347981f-f724-4f94-929a-284576d583d9*6DBFB789961125AA5985A05064BE25ACE64DCEDFA779600BB77CFA9498DA04E5?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/2347981f-f724-4f94-929a-284576d583d9*6DBFB789961125AA5985A05064BE25ACE64DCEDFA779600BB77CFA9498DA04E5","name":"2347981f-f724-4f94-929a-284576d583d9*6DBFB789961125AA5985A05064BE25ACE64DCEDFA779600BB77CFA9498DA04E5","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp_000004","status":"Succeeded","startTime":"2023-01-05T19:31:21.2092085Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - '555' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 19:32:52 GMT + etag: + - '"9e006ed3-0000-0100-0000-63b725cb0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/src/mobile-network/azext_mobile_network/tests/latest/recordings/test_mobile_network_pcdp.yaml b/src/mobile-network/azext_mobile_network/tests/latest/recordings/test_mobile_network_pcdp.yaml new file mode 100644 index 00000000000..3d9854f8aca --- /dev/null +++ b/src/mobile-network/azext_mobile_network/tests/latest/recordings/test_mobile_network_pcdp.yaml @@ -0,0 +1,1153 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network create + Connection: + - keep-alive + ParameterSetName: + - -n -g --identifier + User-Agent: + - AZURECLI/2.43.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_mobile_network000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001","name":"cli_test_mobile_network000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2023-01-04T15:52:47Z","StorageType":"Standard_LRS","type":"test"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '379' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 04 Jan 2023 15:52:59 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus", "properties": {"publicLandMobileNetworkIdentifier": + {"mcc": "001", "mnc": "01"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network create + Connection: + - keep-alive + Content-Length: + - '104' + Content-Type: + - application/json + ParameterSetName: + - -n -g --identifier + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002","name":"mobile_network_000002","type":"microsoft.mobilenetwork/mobilenetworks","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-04T15:53:03.6431525Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-04T15:53:03.6431525Z"},"properties":{"provisioningState":"Succeeded","publicLandMobileNetworkIdentifier":{"mcc":"001","mnc":"01"},"serviceKey":"c9395268-83ce-481a-ac02-07fa4dea6744"}}' + headers: + cache-control: + - no-cache + content-length: + - '679' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 04 Jan 2023 15:53:05 GMT + etag: + - '"96004d51-0000-0100-0000-63b5a0e00000"' + expires: + - '-1' + mise-correlation-id: + - 06dc7293-66db-41c6-89a3-9c041a2473a5 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.1 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network site create + Connection: + - keep-alive + ParameterSetName: + - --mobile-network-name -n -g + User-Agent: + - AZURECLI/2.43.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_mobile_network000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001","name":"cli_test_mobile_network000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2023-01-04T15:52:47Z","StorageType":"Standard_LRS","type":"test"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '379' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 04 Jan 2023 15:53:06 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network site create + Connection: + - keep-alive + Content-Length: + - '22' + Content-Type: + - application/json + ParameterSetName: + - --mobile-network-name -n -g + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/sites/site_000003?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/sites/site_000003","name":"site_000003","type":"microsoft.mobilenetwork/mobilenetworks/sites","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-04T15:53:11.9156671Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-04T15:53:11.9156671Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '580' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 04 Jan 2023 15:53:12 GMT + etag: + - '"f4003140-0000-0100-0000-63b5a0e80000"' + expires: + - '-1' + mise-correlation-id: + - 19f23d27-9cad-4db0-a9b3-fae838feed13 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.1 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network pccp create + Connection: + - keep-alive + ParameterSetName: + - -n -g --access-interface --local-diagnostics --platform --sites --sku + User-Agent: + - AZURECLI/2.43.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_mobile_network000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001","name":"cli_test_mobile_network000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2023-01-04T15:52:47Z","StorageType":"Standard_LRS","type":"test"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '379' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 04 Jan 2023 15:53:13 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus", "properties": {"controlPlaneAccessInterface": {"ipv4Address": + "10.28.128.2", "ipv4Gateway": "10.28.128.1", "ipv4Subnet": "10.28.128.0/24", + "name": "N2"}, "coreNetworkTechnology": "5GC", "localDiagnosticsAccess": {"authenticationType": + "AAD"}, "platform": {"type": "AKS-HCI"}, "sites": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/sites/site_000003"}], + "sku": "G0", "ueMtu": 1440}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network pccp create + Connection: + - keep-alive + Content-Length: + - '535' + Content-Type: + - application/json + ParameterSetName: + - -n -g --access-interface --local-diagnostics --platform --sites --sku + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp_000004?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp_000004","name":"pccp_000004","type":"microsoft.mobilenetwork/packetcorecontrolplanes","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-04T15:53:18.6253751Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-04T15:53:18.6253751Z"},"properties":{"controlPlaneAccessInterface":{"ipv4Address":"10.28.128.2","ipv4Gateway":"10.28.128.1","ipv4Subnet":"10.28.128.0/24","name":"N2"},"coreNetworkTechnology":"5GC","localDiagnosticsAccess":{"authenticationType":"AAD"},"platform":{"type":"AKS-HCI"},"sites":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/sites/site_000003"}],"sku":"G0","ueMtu":1440,"provisioningState":"Accepted"}}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/29ffd478-2cf5-4119-a1c1-f8cca4a51d25*25399D16B5FCCE8905398E5A07F625161C0FF50999D120F113ADF581721D8735?api-version=2022-11-01 + cache-control: + - no-cache + content-length: + - '1036' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 04 Jan 2023 15:53:21 GMT + etag: + - '"4a01453a-0000-0100-0000-63b5a0f00000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.1 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network pccp create + Connection: + - keep-alive + ParameterSetName: + - -n -g --access-interface --local-diagnostics --platform --sites --sku + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/29ffd478-2cf5-4119-a1c1-f8cca4a51d25*25399D16B5FCCE8905398E5A07F625161C0FF50999D120F113ADF581721D8735?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/29ffd478-2cf5-4119-a1c1-f8cca4a51d25*25399D16B5FCCE8905398E5A07F625161C0FF50999D120F113ADF581721D8735","name":"29ffd478-2cf5-4119-a1c1-f8cca4a51d25*25399D16B5FCCE8905398E5A07F625161C0FF50999D120F113ADF581721D8735","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp_000004","status":"Accepted","startTime":"2023-01-04T15:53:20.2887486Z"}' + headers: + cache-control: + - no-cache + content-length: + - '536' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 04 Jan 2023 15:53:52 GMT + etag: + - '"9b008cbe-0000-0100-0000-63b5a0f00000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network pccp create + Connection: + - keep-alive + ParameterSetName: + - -n -g --access-interface --local-diagnostics --platform --sites --sku + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/29ffd478-2cf5-4119-a1c1-f8cca4a51d25*25399D16B5FCCE8905398E5A07F625161C0FF50999D120F113ADF581721D8735?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/29ffd478-2cf5-4119-a1c1-f8cca4a51d25*25399D16B5FCCE8905398E5A07F625161C0FF50999D120F113ADF581721D8735","name":"29ffd478-2cf5-4119-a1c1-f8cca4a51d25*25399D16B5FCCE8905398E5A07F625161C0FF50999D120F113ADF581721D8735","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp_000004","status":"Accepted","startTime":"2023-01-04T15:53:20.2887486Z"}' + headers: + cache-control: + - no-cache + content-length: + - '536' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 04 Jan 2023 15:54:24 GMT + etag: + - '"9b008cbe-0000-0100-0000-63b5a0f00000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network pccp create + Connection: + - keep-alive + ParameterSetName: + - -n -g --access-interface --local-diagnostics --platform --sites --sku + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/29ffd478-2cf5-4119-a1c1-f8cca4a51d25*25399D16B5FCCE8905398E5A07F625161C0FF50999D120F113ADF581721D8735?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/29ffd478-2cf5-4119-a1c1-f8cca4a51d25*25399D16B5FCCE8905398E5A07F625161C0FF50999D120F113ADF581721D8735","name":"29ffd478-2cf5-4119-a1c1-f8cca4a51d25*25399D16B5FCCE8905398E5A07F625161C0FF50999D120F113ADF581721D8735","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp_000004","status":"Succeeded","startTime":"2023-01-04T15:53:20.2887486Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - '555' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 04 Jan 2023 15:54:54 GMT + etag: + - '"1200fea8-0000-0600-0000-63b5a1320000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network pccp create + Connection: + - keep-alive + ParameterSetName: + - -n -g --access-interface --local-diagnostics --platform --sites --sku + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp_000004?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp_000004","name":"pccp_000004","type":"microsoft.mobilenetwork/packetcorecontrolplanes","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-04T15:53:18.6253751Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-04T15:53:18.6253751Z"},"properties":{"provisioningState":"Succeeded","sites":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/sites/site_000003"}],"platform":{"type":"AKS-HCI"},"coreNetworkTechnology":"5GC","controlPlaneAccessInterface":{"name":"N2","ipv4Address":"10.28.128.2","ipv4Subnet":"10.28.128.0/24","ipv4Gateway":"10.28.128.1"},"sku":"G0","ueMtu":1440,"localDiagnosticsAccess":{"authenticationType":"AAD"}}}' + headers: + cache-control: + - no-cache + content-length: + - '1037' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 04 Jan 2023 15:54:55 GMT + etag: + - '"4a014d3a-0000-0100-0000-63b5a0fb0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.1 + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network pcdp create + Connection: + - keep-alive + ParameterSetName: + - -n -g --pccp-name --access-interface + User-Agent: + - AZURECLI/2.43.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_mobile_network000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001","name":"cli_test_mobile_network000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2023-01-04T15:52:47Z","StorageType":"Standard_LRS","type":"test"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '379' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 04 Jan 2023 15:54:56 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus", "properties": {"userPlaneAccessInterface": {"ipv4Address": + "10.28.128.2", "ipv4Gateway": "10.28.128.1", "ipv4Subnet": "10.28.128.0/24", + "name": "N2"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network pcdp create + Connection: + - keep-alive + Content-Length: + - '174' + Content-Type: + - application/json + ParameterSetName: + - -n -g --pccp-name --access-interface + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp_000004/packetCoreDataPlanes/pcdp_000005?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp_000004/packetCoreDataPlanes/pcdp_000005","name":"pcdp_000005","type":"microsoft.mobilenetwork/packetcorecontrolplanes/packetcoredataplanes","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-04T15:55:00.5529752Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-04T15:55:00.5529752Z"},"properties":{"userPlaneAccessInterface":{"ipv4Address":"10.28.128.2","ipv4Gateway":"10.28.128.1","ipv4Subnet":"10.28.128.0/24","name":"N2"},"provisioningState":"Accepted"}}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/9e1d8028-7eff-4650-8a1b-0ee8b8056a4d*C6A27A2175584DCA19EFEB9004ACBE982CC82E40C82AC4D9136B4FC35BBC5738?api-version=2022-11-01 + cache-control: + - no-cache + content-length: + - '744' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 04 Jan 2023 15:55:04 GMT + etag: + - '"130035d1-0000-0100-0000-63b5a1560000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.1 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network pcdp create + Connection: + - keep-alive + ParameterSetName: + - -n -g --pccp-name --access-interface + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/9e1d8028-7eff-4650-8a1b-0ee8b8056a4d*C6A27A2175584DCA19EFEB9004ACBE982CC82E40C82AC4D9136B4FC35BBC5738?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/9e1d8028-7eff-4650-8a1b-0ee8b8056a4d*C6A27A2175584DCA19EFEB9004ACBE982CC82E40C82AC4D9136B4FC35BBC5738","name":"9e1d8028-7eff-4650-8a1b-0ee8b8056a4d*C6A27A2175584DCA19EFEB9004ACBE982CC82E40C82AC4D9136B4FC35BBC5738","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp_000004/packetCoreDataPlanes/pcdp_000005","status":"Accepted","startTime":"2023-01-04T15:55:01.6057515Z"}' + headers: + cache-control: + - no-cache + content-length: + - '569' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 04 Jan 2023 15:55:33 GMT + etag: + - '"9b004fc0-0000-0100-0000-63b5a1550000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network pcdp create + Connection: + - keep-alive + ParameterSetName: + - -n -g --pccp-name --access-interface + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/9e1d8028-7eff-4650-8a1b-0ee8b8056a4d*C6A27A2175584DCA19EFEB9004ACBE982CC82E40C82AC4D9136B4FC35BBC5738?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/9e1d8028-7eff-4650-8a1b-0ee8b8056a4d*C6A27A2175584DCA19EFEB9004ACBE982CC82E40C82AC4D9136B4FC35BBC5738","name":"9e1d8028-7eff-4650-8a1b-0ee8b8056a4d*C6A27A2175584DCA19EFEB9004ACBE982CC82E40C82AC4D9136B4FC35BBC5738","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp_000004/packetCoreDataPlanes/pcdp_000005","status":"Accepted","startTime":"2023-01-04T15:55:01.6057515Z"}' + headers: + cache-control: + - no-cache + content-length: + - '569' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 04 Jan 2023 15:56:04 GMT + etag: + - '"9b004fc0-0000-0100-0000-63b5a1550000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network pcdp create + Connection: + - keep-alive + ParameterSetName: + - -n -g --pccp-name --access-interface + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/9e1d8028-7eff-4650-8a1b-0ee8b8056a4d*C6A27A2175584DCA19EFEB9004ACBE982CC82E40C82AC4D9136B4FC35BBC5738?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/9e1d8028-7eff-4650-8a1b-0ee8b8056a4d*C6A27A2175584DCA19EFEB9004ACBE982CC82E40C82AC4D9136B4FC35BBC5738","name":"9e1d8028-7eff-4650-8a1b-0ee8b8056a4d*C6A27A2175584DCA19EFEB9004ACBE982CC82E40C82AC4D9136B4FC35BBC5738","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp_000004/packetCoreDataPlanes/pcdp_000005","status":"Succeeded","startTime":"2023-01-04T15:55:01.6057515Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - '588' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 04 Jan 2023 15:56:35 GMT + etag: + - '"1200c7aa-0000-0600-0000-63b5a1970000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network pcdp create + Connection: + - keep-alive + ParameterSetName: + - -n -g --pccp-name --access-interface + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp_000004/packetCoreDataPlanes/pcdp_000005?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp_000004/packetCoreDataPlanes/pcdp_000005","name":"pcdp_000005","type":"microsoft.mobilenetwork/packetcorecontrolplanes/packetcoredataplanes","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-04T15:55:00.5529752Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-04T15:55:00.5529752Z"},"properties":{"userPlaneAccessInterface":{"ipv4Address":"10.28.128.2","ipv4Gateway":"10.28.128.1","ipv4Subnet":"10.28.128.0/24","name":"N2"},"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '745' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 04 Jan 2023 15:56:36 GMT + etag: + - '"130058d1-0000-0100-0000-63b5a15f0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: '{"tags": {"tag": "test", "tag2": "test2"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network pcdp update + Connection: + - keep-alive + Content-Length: + - '42' + Content-Type: + - application/json + ParameterSetName: + - -n -g --pccp-name --tags + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: PATCH + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp_000004/packetCoreDataPlanes/pcdp_000005?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp_000004/packetCoreDataPlanes/pcdp_000005","name":"pcdp_000005","type":"microsoft.mobilenetwork/packetcorecontrolplanes/packetcoredataplanes","location":"eastus","tags":{"tag":"test","tag2":"test2"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-04T15:55:00.5529752Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-04T15:56:37.8534034Z"},"properties":{"userPlaneAccessInterface":{"ipv4Address":"10.28.128.2","ipv4Gateway":"10.28.128.1","ipv4Subnet":"10.28.128.0/24","name":"N2"},"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '782' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 04 Jan 2023 15:56:41 GMT + etag: + - '"1300bfd4-0000-0100-0000-63b5a1b60000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network pcdp list + Connection: + - keep-alive + ParameterSetName: + - -g --pccp-name + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp_000004/packetCoreDataPlanes?api-version=2022-11-01 + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp_000004/packetCoreDataPlanes/pcdp_000005","name":"pcdp_000005","type":"microsoft.mobilenetwork/packetcorecontrolplanes/packetcoredataplanes","location":"eastus","tags":{"tag":"test","tag2":"test2"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-04T15:55:00.5529752Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-04T15:56:37.8534034Z"},"properties":{"userPlaneAccessInterface":{"ipv4Address":"10.28.128.2","ipv4Gateway":"10.28.128.1","ipv4Subnet":"10.28.128.0/24","name":"N2"},"provisioningState":"Succeeded"}}]}' + headers: + cache-control: + - no-cache + content-length: + - '794' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 04 Jan 2023 15:56:42 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-original-request-ids: + - 7ab78a4d-4a2c-44e7-a96f-b2e9c1a2ac69 + - d196a014-878c-4db4-abf5-260c5735db42 + - 12435d82-025f-46fb-85a0-9154e2b4cf6f + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network pcdp show + Connection: + - keep-alive + ParameterSetName: + - -g -n --pccp-name + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp_000004/packetCoreDataPlanes/pcdp_000005?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp_000004/packetCoreDataPlanes/pcdp_000005","name":"pcdp_000005","type":"microsoft.mobilenetwork/packetcorecontrolplanes/packetcoredataplanes","location":"eastus","tags":{"tag":"test","tag2":"test2"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-04T15:55:00.5529752Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-04T15:56:37.8534034Z"},"properties":{"userPlaneAccessInterface":{"ipv4Address":"10.28.128.2","ipv4Gateway":"10.28.128.1","ipv4Subnet":"10.28.128.0/24","name":"N2"},"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '782' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 04 Jan 2023 15:56:44 GMT + etag: + - '"1300bfd4-0000-0100-0000-63b5a1b60000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network pcdp delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -g -n --pccp-name -y + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp_000004/packetCoreDataPlanes/pcdp_000005?api-version=2022-11-01 + response: + body: + string: 'null' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/71100e40-d150-43e7-bf14-8aab321055b0*C6A27A2175584DCA19EFEB9004ACBE982CC82E40C82AC4D9136B4FC35BBC5738?api-version=2022-11-01 + cache-control: + - no-cache + content-length: + - '4' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 04 Jan 2023 15:56:48 GMT + etag: + - '"1300e8d4-0000-0100-0000-63b5a1bf0000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/71100e40-d150-43e7-bf14-8aab321055b0*C6A27A2175584DCA19EFEB9004ACBE982CC82E40C82AC4D9136B4FC35BBC5738?api-version=2022-11-01 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.1 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network pcdp delete + Connection: + - keep-alive + ParameterSetName: + - -g -n --pccp-name -y + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/71100e40-d150-43e7-bf14-8aab321055b0*C6A27A2175584DCA19EFEB9004ACBE982CC82E40C82AC4D9136B4FC35BBC5738?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/71100e40-d150-43e7-bf14-8aab321055b0*C6A27A2175584DCA19EFEB9004ACBE982CC82E40C82AC4D9136B4FC35BBC5738","name":"71100e40-d150-43e7-bf14-8aab321055b0*C6A27A2175584DCA19EFEB9004ACBE982CC82E40C82AC4D9136B4FC35BBC5738","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp_000004/packetCoreDataPlanes/pcdp_000005","status":"Deleting","startTime":"2023-01-04T15:56:47.003071Z"}' + headers: + cache-control: + - no-cache + content-length: + - '568' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 04 Jan 2023 15:57:18 GMT + etag: + - '"9b00cdc1-0000-0100-0000-63b5a1bf0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network pcdp delete + Connection: + - keep-alive + ParameterSetName: + - -g -n --pccp-name -y + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/71100e40-d150-43e7-bf14-8aab321055b0*C6A27A2175584DCA19EFEB9004ACBE982CC82E40C82AC4D9136B4FC35BBC5738?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/71100e40-d150-43e7-bf14-8aab321055b0*C6A27A2175584DCA19EFEB9004ACBE982CC82E40C82AC4D9136B4FC35BBC5738","name":"71100e40-d150-43e7-bf14-8aab321055b0*C6A27A2175584DCA19EFEB9004ACBE982CC82E40C82AC4D9136B4FC35BBC5738","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp_000004/packetCoreDataPlanes/pcdp_000005","status":"Deleting","startTime":"2023-01-04T15:56:47.003071Z"}' + headers: + cache-control: + - no-cache + content-length: + - '568' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 04 Jan 2023 15:57:51 GMT + etag: + - '"9b00cdc1-0000-0100-0000-63b5a1bf0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network pcdp delete + Connection: + - keep-alive + ParameterSetName: + - -g -n --pccp-name -y + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/71100e40-d150-43e7-bf14-8aab321055b0*C6A27A2175584DCA19EFEB9004ACBE982CC82E40C82AC4D9136B4FC35BBC5738?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/71100e40-d150-43e7-bf14-8aab321055b0*C6A27A2175584DCA19EFEB9004ACBE982CC82E40C82AC4D9136B4FC35BBC5738","name":"71100e40-d150-43e7-bf14-8aab321055b0*C6A27A2175584DCA19EFEB9004ACBE982CC82E40C82AC4D9136B4FC35BBC5738","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp_000004/packetCoreDataPlanes/pcdp_000005","status":"Succeeded","startTime":"2023-01-04T15:56:47.003071Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - '587' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 04 Jan 2023 15:58:37 GMT + etag: + - '"1200ecab-0000-0600-0000-63b5a2010000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network pcdp delete + Connection: + - keep-alive + ParameterSetName: + - -g -n --pccp-name -y + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/71100e40-d150-43e7-bf14-8aab321055b0*C6A27A2175584DCA19EFEB9004ACBE982CC82E40C82AC4D9136B4FC35BBC5738?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/71100e40-d150-43e7-bf14-8aab321055b0*C6A27A2175584DCA19EFEB9004ACBE982CC82E40C82AC4D9136B4FC35BBC5738","name":"71100e40-d150-43e7-bf14-8aab321055b0*C6A27A2175584DCA19EFEB9004ACBE982CC82E40C82AC4D9136B4FC35BBC5738","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/pccp_000004/packetCoreDataPlanes/pcdp_000005","status":"Succeeded","startTime":"2023-01-04T15:56:47.003071Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - '587' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 04 Jan 2023 15:58:37 GMT + etag: + - '"1200ecab-0000-0600-0000-63b5a2010000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/src/mobile-network/azext_mobile_network/tests/latest/recordings/test_mobile_network_service.yaml b/src/mobile-network/azext_mobile_network/tests/latest/recordings/test_mobile_network_service.yaml new file mode 100644 index 00000000000..cc330b1dc47 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/tests/latest/recordings/test_mobile_network_service.yaml @@ -0,0 +1,1003 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network create + Connection: + - keep-alive + ParameterSetName: + - -n -g --identifier + User-Agent: + - AZURECLI/2.43.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_mobile_network000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001","name":"cli_test_mobile_network000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2023-01-05T09:08:17Z","StorageType":"Standard_LRS","type":"test"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '379' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 09:08:27 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus", "properties": {"publicLandMobileNetworkIdentifier": + {"mcc": "001", "mnc": "01"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network create + Connection: + - keep-alive + Content-Length: + - '104' + Content-Type: + - application/json + ParameterSetName: + - -n -g --identifier + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002","name":"mobile_network_000002","type":"microsoft.mobilenetwork/mobilenetworks","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-05T09:08:32.8643609Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-05T09:08:32.8643609Z"},"properties":{"provisioningState":"Succeeded","publicLandMobileNetworkIdentifier":{"mcc":"001","mnc":"01"},"serviceKey":"4859ec2a-b278-4c08-8bca-2aa207d0f85d"}}' + headers: + cache-control: + - no-cache + content-length: + - '679' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 09:08:36 GMT + etag: + - '"9e00b394-0000-0100-0000-63b693930000"' + expires: + - '-1' + mise-correlation-id: + - 4250251f-be65-4b8c-910b-6a4d99fc749b + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.1 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network service create + Connection: + - keep-alive + ParameterSetName: + - -n -g --mobile-network-name --pcc-rules --service-precedence + User-Agent: + - AZURECLI/2.43.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_mobile_network000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001","name":"cli_test_mobile_network000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2023-01-05T09:08:17Z","StorageType":"Standard_LRS","type":"test"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '379' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 09:08:36 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus", "properties": {"pccRules": [{"ruleName": "default-rule", + "rulePrecedence": 10, "serviceDataFlowTemplates": [{"direction": "Uplink", "protocol": + ["ip"], "remoteIpList": ["10.3.4.0/24"], "templateName": "IP-to-server"}]}], + "servicePrecedence": 10}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network service create + Connection: + - keep-alive + Content-Length: + - '269' + Content-Type: + - application/json + ParameterSetName: + - -n -g --mobile-network-name --pcc-rules --service-precedence + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/services/ser000003?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/services/ser000003","name":"ser000003","type":"microsoft.mobilenetwork/mobilenetworks/services","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-05T09:08:41.2156676Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-05T09:08:41.2156676Z"},"properties":{"pccRules":[{"ruleName":"default-rule","rulePrecedence":10,"serviceDataFlowTemplates":[{"direction":"Uplink","protocol":["ip"],"remoteIpList":["10.3.4.0/24"],"templateName":"IP-to-server"}]}],"servicePrecedence":10,"provisioningState":"Accepted"}}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/d4fba09c-73b0-43f5-8477-c4e6af30b424*79EE0BE11D28823D4A0BE0802D2327E82E14FA5A3A9822C3A6FB6E9A7E9D2C0F?api-version=2022-11-01 + cache-control: + - no-cache + content-length: + - '796' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 09:08:43 GMT + etag: + - '"1600ae39-0000-0100-0000-63b6939a0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.1 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network service create + Connection: + - keep-alive + ParameterSetName: + - -n -g --mobile-network-name --pcc-rules --service-precedence + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/d4fba09c-73b0-43f5-8477-c4e6af30b424*79EE0BE11D28823D4A0BE0802D2327E82E14FA5A3A9822C3A6FB6E9A7E9D2C0F?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/d4fba09c-73b0-43f5-8477-c4e6af30b424*79EE0BE11D28823D4A0BE0802D2327E82E14FA5A3A9822C3A6FB6E9A7E9D2C0F","name":"d4fba09c-73b0-43f5-8477-c4e6af30b424*79EE0BE11D28823D4A0BE0802D2327E82E14FA5A3A9822C3A6FB6E9A7E9D2C0F","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/services/ser000003","status":"Accepted","startTime":"2023-01-05T09:08:42.1903997Z"}' + headers: + cache-control: + - no-cache + content-length: + - '556' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 09:09:14 GMT + etag: + - '"9d002288-0000-0100-0000-63b6939a0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network service create + Connection: + - keep-alive + ParameterSetName: + - -n -g --mobile-network-name --pcc-rules --service-precedence + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/d4fba09c-73b0-43f5-8477-c4e6af30b424*79EE0BE11D28823D4A0BE0802D2327E82E14FA5A3A9822C3A6FB6E9A7E9D2C0F?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/d4fba09c-73b0-43f5-8477-c4e6af30b424*79EE0BE11D28823D4A0BE0802D2327E82E14FA5A3A9822C3A6FB6E9A7E9D2C0F","name":"d4fba09c-73b0-43f5-8477-c4e6af30b424*79EE0BE11D28823D4A0BE0802D2327E82E14FA5A3A9822C3A6FB6E9A7E9D2C0F","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/services/ser000003","status":"Accepted","startTime":"2023-01-05T09:08:42.1903997Z"}' + headers: + cache-control: + - no-cache + content-length: + - '556' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 09:09:45 GMT + etag: + - '"9d002288-0000-0100-0000-63b6939a0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network service create + Connection: + - keep-alive + ParameterSetName: + - -n -g --mobile-network-name --pcc-rules --service-precedence + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/d4fba09c-73b0-43f5-8477-c4e6af30b424*79EE0BE11D28823D4A0BE0802D2327E82E14FA5A3A9822C3A6FB6E9A7E9D2C0F?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/d4fba09c-73b0-43f5-8477-c4e6af30b424*79EE0BE11D28823D4A0BE0802D2327E82E14FA5A3A9822C3A6FB6E9A7E9D2C0F","name":"d4fba09c-73b0-43f5-8477-c4e6af30b424*79EE0BE11D28823D4A0BE0802D2327E82E14FA5A3A9822C3A6FB6E9A7E9D2C0F","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/services/ser000003","status":"Succeeded","startTime":"2023-01-05T09:08:42.1903997Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - '575' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 09:10:16 GMT + etag: + - '"1400883c-0000-0600-0000-63b693dd0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network service create + Connection: + - keep-alive + ParameterSetName: + - -n -g --mobile-network-name --pcc-rules --service-precedence + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/services/ser000003?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/services/ser000003","name":"ser000003","type":"microsoft.mobilenetwork/mobilenetworks/services","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-05T09:08:41.2156676Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-05T09:08:41.2156676Z"},"properties":{"pccRules":[{"ruleName":"default-rule","rulePrecedence":10,"serviceDataFlowTemplates":[{"direction":"Uplink","protocol":["ip"],"remoteIpList":["10.3.4.0/24"],"templateName":"IP-to-server"}]}],"servicePrecedence":10,"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '797' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 09:10:17 GMT + etag: + - '"1600af39-0000-0100-0000-63b693a10000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network service update + Connection: + - keep-alive + ParameterSetName: + - --mobile-network-name -g -n --tags + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/services/ser000003?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/services/ser000003","name":"ser000003","type":"microsoft.mobilenetwork/mobilenetworks/services","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-05T09:08:41.2156676Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-05T09:08:41.2156676Z"},"properties":{"pccRules":[{"ruleName":"default-rule","rulePrecedence":10,"serviceDataFlowTemplates":[{"direction":"Uplink","protocol":["ip"],"remoteIpList":["10.3.4.0/24"],"templateName":"IP-to-server"}]}],"servicePrecedence":10,"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '797' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 09:10:20 GMT + etag: + - '"1600af39-0000-0100-0000-63b693a10000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus", "properties": {"pccRules": [{"ruleName": "default-rule", + "rulePrecedence": 10, "serviceDataFlowTemplates": [{"direction": "Uplink", "protocol": + ["ip"], "remoteIpList": ["10.3.4.0/24"], "templateName": "IP-to-server"}]}], + "servicePrecedence": 10}, "tags": {"tag": "test", "tag2": "test2"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network service update + Connection: + - keep-alive + Content-Length: + - '311' + Content-Type: + - application/json + ParameterSetName: + - --mobile-network-name -g -n --tags + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/services/ser000003?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/services/ser000003","name":"ser000003","type":"microsoft.mobilenetwork/mobilenetworks/services","location":"eastus","tags":{"tag":"test","tag2":"test2"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-05T09:08:41.2156676Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-05T09:10:20.6449796Z"},"properties":{"provisioningState":"Accepted","pccRules":[{"ruleName":"default-rule","rulePrecedence":10,"serviceDataFlowTemplates":[{"direction":"Uplink","protocol":["ip"],"remoteIpList":["10.3.4.0/24"],"templateName":"IP-to-server"}]}],"servicePrecedence":10}}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/70f5ca33-15a5-40af-a8f3-15b3fef13bfa*79EE0BE11D28823D4A0BE0802D2327E82E14FA5A3A9822C3A6FB6E9A7E9D2C0F?api-version=2022-11-01 + cache-control: + - no-cache + content-length: + - '833' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 09:10:24 GMT + etag: + - '"1600b339-0000-0100-0000-63b693fd0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.1 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network service update + Connection: + - keep-alive + ParameterSetName: + - --mobile-network-name -g -n --tags + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/70f5ca33-15a5-40af-a8f3-15b3fef13bfa*79EE0BE11D28823D4A0BE0802D2327E82E14FA5A3A9822C3A6FB6E9A7E9D2C0F?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/70f5ca33-15a5-40af-a8f3-15b3fef13bfa*79EE0BE11D28823D4A0BE0802D2327E82E14FA5A3A9822C3A6FB6E9A7E9D2C0F","name":"70f5ca33-15a5-40af-a8f3-15b3fef13bfa*79EE0BE11D28823D4A0BE0802D2327E82E14FA5A3A9822C3A6FB6E9A7E9D2C0F","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/services/ser000003","status":"Accepted","startTime":"2023-01-05T09:10:21.0106395Z"}' + headers: + cache-control: + - no-cache + content-length: + - '556' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 09:10:55 GMT + etag: + - '"9d00cd88-0000-0100-0000-63b693fd0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network service update + Connection: + - keep-alive + ParameterSetName: + - --mobile-network-name -g -n --tags + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/70f5ca33-15a5-40af-a8f3-15b3fef13bfa*79EE0BE11D28823D4A0BE0802D2327E82E14FA5A3A9822C3A6FB6E9A7E9D2C0F?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/70f5ca33-15a5-40af-a8f3-15b3fef13bfa*79EE0BE11D28823D4A0BE0802D2327E82E14FA5A3A9822C3A6FB6E9A7E9D2C0F","name":"70f5ca33-15a5-40af-a8f3-15b3fef13bfa*79EE0BE11D28823D4A0BE0802D2327E82E14FA5A3A9822C3A6FB6E9A7E9D2C0F","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/services/ser000003","status":"Accepted","startTime":"2023-01-05T09:10:21.0106395Z"}' + headers: + cache-control: + - no-cache + content-length: + - '556' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 09:11:26 GMT + etag: + - '"9d00cd88-0000-0100-0000-63b693fd0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network service update + Connection: + - keep-alive + ParameterSetName: + - --mobile-network-name -g -n --tags + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/70f5ca33-15a5-40af-a8f3-15b3fef13bfa*79EE0BE11D28823D4A0BE0802D2327E82E14FA5A3A9822C3A6FB6E9A7E9D2C0F?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/70f5ca33-15a5-40af-a8f3-15b3fef13bfa*79EE0BE11D28823D4A0BE0802D2327E82E14FA5A3A9822C3A6FB6E9A7E9D2C0F","name":"70f5ca33-15a5-40af-a8f3-15b3fef13bfa*79EE0BE11D28823D4A0BE0802D2327E82E14FA5A3A9822C3A6FB6E9A7E9D2C0F","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/services/ser000003","status":"Succeeded","startTime":"2023-01-05T09:10:21.0106395Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - '575' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 09:11:57 GMT + etag: + - '"1400903c-0000-0600-0000-63b6943f0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network service update + Connection: + - keep-alive + ParameterSetName: + - --mobile-network-name -g -n --tags + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/services/ser000003?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/services/ser000003","name":"ser000003","type":"microsoft.mobilenetwork/mobilenetworks/services","location":"eastus","tags":{"tag":"test","tag2":"test2"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-05T09:08:41.2156676Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-05T09:10:20.6449796Z"},"properties":{"provisioningState":"Succeeded","pccRules":[{"ruleName":"default-rule","rulePrecedence":10,"serviceDataFlowTemplates":[{"direction":"Uplink","protocol":["ip"],"remoteIpList":["10.3.4.0/24"],"templateName":"IP-to-server"}]}],"servicePrecedence":10}}' + headers: + cache-control: + - no-cache + content-length: + - '834' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 09:11:57 GMT + etag: + - '"1600b439-0000-0100-0000-63b694040000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network service list + Connection: + - keep-alive + ParameterSetName: + - --mobile-network-name -g + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/services?api-version=2022-11-01 + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/services/ser000003","name":"ser000003","type":"microsoft.mobilenetwork/mobilenetworks/services","location":"eastus","tags":{"tag":"test","tag2":"test2"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-05T09:08:41.2156676Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-05T09:10:20.6449796Z"},"properties":{"provisioningState":"Succeeded","pccRules":[{"ruleName":"default-rule","rulePrecedence":10,"serviceDataFlowTemplates":[{"direction":"Uplink","protocol":["ip"],"remoteIpList":["10.3.4.0/24"],"templateName":"IP-to-server"}]}],"servicePrecedence":10}}]}' + headers: + cache-control: + - no-cache + content-length: + - '846' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 09:12:04 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-original-request-ids: + - 38aaaea8-1ada-4f26-85a2-532e9065ab97 + - 0fc6c937-6d9e-4a94-b8e2-1e7c4cfbfb23 + - 79f05b18-bdaa-4184-935f-364fb55562e0 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network service show + Connection: + - keep-alive + ParameterSetName: + - --mobile-network-name -n -g + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/services/ser000003?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/services/ser000003","name":"ser000003","type":"microsoft.mobilenetwork/mobilenetworks/services","location":"eastus","tags":{"tag":"test","tag2":"test2"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-05T09:08:41.2156676Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-05T09:10:20.6449796Z"},"properties":{"provisioningState":"Succeeded","pccRules":[{"ruleName":"default-rule","rulePrecedence":10,"serviceDataFlowTemplates":[{"direction":"Uplink","protocol":["ip"],"remoteIpList":["10.3.4.0/24"],"templateName":"IP-to-server"}]}],"servicePrecedence":10}}' + headers: + cache-control: + - no-cache + content-length: + - '834' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 09:12:05 GMT + etag: + - '"1600b439-0000-0100-0000-63b694040000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network service delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --mobile-network-name -n -g -y + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/services/ser000003?api-version=2022-11-01 + response: + body: + string: 'null' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/e6a73509-28bc-46f0-a350-452e0bed0d19*79EE0BE11D28823D4A0BE0802D2327E82E14FA5A3A9822C3A6FB6E9A7E9D2C0F?api-version=2022-11-01 + cache-control: + - no-cache + content-length: + - '4' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 09:12:10 GMT + etag: + - '"1600bc39-0000-0100-0000-63b694690000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/e6a73509-28bc-46f0-a350-452e0bed0d19*79EE0BE11D28823D4A0BE0802D2327E82E14FA5A3A9822C3A6FB6E9A7E9D2C0F?api-version=2022-11-01 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.1 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network service delete + Connection: + - keep-alive + ParameterSetName: + - --mobile-network-name -n -g -y + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/e6a73509-28bc-46f0-a350-452e0bed0d19*79EE0BE11D28823D4A0BE0802D2327E82E14FA5A3A9822C3A6FB6E9A7E9D2C0F?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/e6a73509-28bc-46f0-a350-452e0bed0d19*79EE0BE11D28823D4A0BE0802D2327E82E14FA5A3A9822C3A6FB6E9A7E9D2C0F","name":"e6a73509-28bc-46f0-a350-452e0bed0d19*79EE0BE11D28823D4A0BE0802D2327E82E14FA5A3A9822C3A6FB6E9A7E9D2C0F","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/services/ser000003","status":"Deleting","startTime":"2023-01-05T09:12:09.5754697Z"}' + headers: + cache-control: + - no-cache + content-length: + - '556' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 09:12:40 GMT + etag: + - '"9d007a89-0000-0100-0000-63b694690000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network service delete + Connection: + - keep-alive + ParameterSetName: + - --mobile-network-name -n -g -y + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/e6a73509-28bc-46f0-a350-452e0bed0d19*79EE0BE11D28823D4A0BE0802D2327E82E14FA5A3A9822C3A6FB6E9A7E9D2C0F?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/e6a73509-28bc-46f0-a350-452e0bed0d19*79EE0BE11D28823D4A0BE0802D2327E82E14FA5A3A9822C3A6FB6E9A7E9D2C0F","name":"e6a73509-28bc-46f0-a350-452e0bed0d19*79EE0BE11D28823D4A0BE0802D2327E82E14FA5A3A9822C3A6FB6E9A7E9D2C0F","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/services/ser000003","status":"Deleting","startTime":"2023-01-05T09:12:09.5754697Z"}' + headers: + cache-control: + - no-cache + content-length: + - '556' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 09:13:12 GMT + etag: + - '"9d007a89-0000-0100-0000-63b694690000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network service delete + Connection: + - keep-alive + ParameterSetName: + - --mobile-network-name -n -g -y + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/e6a73509-28bc-46f0-a350-452e0bed0d19*79EE0BE11D28823D4A0BE0802D2327E82E14FA5A3A9822C3A6FB6E9A7E9D2C0F?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/e6a73509-28bc-46f0-a350-452e0bed0d19*79EE0BE11D28823D4A0BE0802D2327E82E14FA5A3A9822C3A6FB6E9A7E9D2C0F","name":"e6a73509-28bc-46f0-a350-452e0bed0d19*79EE0BE11D28823D4A0BE0802D2327E82E14FA5A3A9822C3A6FB6E9A7E9D2C0F","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/services/ser000003","status":"Succeeded","startTime":"2023-01-05T09:12:09.5754697Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - '575' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 09:13:42 GMT + etag: + - '"1400993c-0000-0600-0000-63b694ac0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network service delete + Connection: + - keep-alive + ParameterSetName: + - --mobile-network-name -n -g -y + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/e6a73509-28bc-46f0-a350-452e0bed0d19*79EE0BE11D28823D4A0BE0802D2327E82E14FA5A3A9822C3A6FB6E9A7E9D2C0F?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/e6a73509-28bc-46f0-a350-452e0bed0d19*79EE0BE11D28823D4A0BE0802D2327E82E14FA5A3A9822C3A6FB6E9A7E9D2C0F","name":"e6a73509-28bc-46f0-a350-452e0bed0d19*79EE0BE11D28823D4A0BE0802D2327E82E14FA5A3A9822C3A6FB6E9A7E9D2C0F","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/services/ser000003","status":"Succeeded","startTime":"2023-01-05T09:12:09.5754697Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - '575' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 09:13:43 GMT + etag: + - '"1400993c-0000-0600-0000-63b694ac0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/src/mobile-network/azext_mobile_network/tests/latest/recordings/test_mobile_network_sim.yaml b/src/mobile-network/azext_mobile_network/tests/latest/recordings/test_mobile_network_sim.yaml new file mode 100644 index 00000000000..4387e21c4cf --- /dev/null +++ b/src/mobile-network/azext_mobile_network/tests/latest/recordings/test_mobile_network_sim.yaml @@ -0,0 +1,1309 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network create + Connection: + - keep-alive + ParameterSetName: + - -n -g --identifier + User-Agent: + - AZURECLI/2.43.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_mobile_network000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001","name":"cli_test_mobile_network000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2023-01-05T14:16:09Z","StorageType":"Standard_LRS","type":"test"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '379' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 14:16:20 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus", "properties": {"publicLandMobileNetworkIdentifier": + {"mcc": "001", "mnc": "01"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network create + Connection: + - keep-alive + Content-Length: + - '104' + Content-Type: + - application/json + ParameterSetName: + - -n -g --identifier + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002","name":"mobile_network_000002","type":"microsoft.mobilenetwork/mobilenetworks","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-05T14:16:25.0978652Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-05T14:16:25.0978652Z"},"properties":{"provisioningState":"Succeeded","publicLandMobileNetworkIdentifier":{"mcc":"001","mnc":"01"},"serviceKey":"b28bc5c6-941d-4ad7-a227-b7d999a6a55d"}}' + headers: + cache-control: + - no-cache + content-length: + - '679' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 14:16:26 GMT + etag: + - '"a100dbb1-0000-0100-0000-63b6dbb90000"' + expires: + - '-1' + mise-correlation-id: + - d1a55ddf-47a2-44f8-899b-f5f5cc6e1a8a + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.1 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network sim group create + Connection: + - keep-alive + ParameterSetName: + - -n -g --mobile-network + User-Agent: + - AZURECLI/2.43.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_mobile_network000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001","name":"cli_test_mobile_network000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2023-01-05T14:16:09Z","StorageType":"Standard_LRS","type":"test"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '379' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 14:16:27 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus", "properties": {"mobileNetwork": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network sim group create + Connection: + - keep-alive + Content-Length: + - '234' + Content-Type: + - application/json + ParameterSetName: + - -n -g --mobile-network + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/simGroups/simgroup000003?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/simGroups/simgroup000003","name":"simgroup000003","type":"microsoft.mobilenetwork/simgroups","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-05T14:16:35.072478Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-05T14:21:33.1214848Z"},"properties":{"provisioningState":"Accepted","mobileNetwork":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002"}}}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/fce9bd1e-020d-480d-8144-c37845165540*E44602EE0F22E031208D6172F1F33263FAF762FFA2F33997B936F69200D4058E?api-version=2022-11-01 + cache-control: + - no-cache + content-length: + - '733' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 14:21:34 GMT + etag: + - '"8e03593c-0000-0100-0000-63b6dcee0000"' + expires: + - '-1' + mise-correlation-id: + - 2f42a867-78f6-4734-bd0d-31309171e692 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.1 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network sim group create + Connection: + - keep-alive + ParameterSetName: + - -n -g --mobile-network + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/fce9bd1e-020d-480d-8144-c37845165540*E44602EE0F22E031208D6172F1F33263FAF762FFA2F33997B936F69200D4058E?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/fce9bd1e-020d-480d-8144-c37845165540*E44602EE0F22E031208D6172F1F33263FAF762FFA2F33997B936F69200D4058E","name":"fce9bd1e-020d-480d-8144-c37845165540*E44602EE0F22E031208D6172F1F33263FAF762FFA2F33997B936F69200D4058E","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/simGroups/simgroup000003","status":"Succeeded","startTime":"2023-01-05T14:21:34.1361226Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - '544' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 14:22:04 GMT + etag: + - '"15002b02-0000-0600-0000-63b6dcf40000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network sim group create + Connection: + - keep-alive + ParameterSetName: + - -n -g --mobile-network + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/simGroups/simgroup000003?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/simGroups/simgroup000003","name":"simgroup000003","type":"microsoft.mobilenetwork/simgroups","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-05T14:16:35.072478Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-05T14:21:33.1214848Z"},"properties":{"provisioningState":"Succeeded","mobileNetwork":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002"}}}' + headers: + cache-control: + - no-cache + content-length: + - '734' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 14:22:04 GMT + etag: + - '"8e03ab3c-0000-0100-0000-63b6dcf40000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network sim group update + Connection: + - keep-alive + ParameterSetName: + - -n -g --tags + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/simGroups/simgroup000003?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/simGroups/simgroup000003","name":"simgroup000003","type":"microsoft.mobilenetwork/simgroups","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-05T14:16:35.072478Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-05T14:21:33.1214848Z"},"properties":{"provisioningState":"Succeeded","mobileNetwork":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002"}}}' + headers: + cache-control: + - no-cache + content-length: + - '734' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 14:22:06 GMT + etag: + - '"8e03ab3c-0000-0100-0000-63b6dcf40000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus", "properties": {"mobileNetwork": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002"}}, + "tags": {"tag": "test", "tag2": "test2"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network sim group update + Connection: + - keep-alive + Content-Length: + - '276' + Content-Type: + - application/json + ParameterSetName: + - -n -g --tags + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/simGroups/simgroup000003?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/simGroups/simgroup000003","name":"simgroup000003","type":"microsoft.mobilenetwork/simgroups","location":"eastus","tags":{"tag":"test","tag2":"test2"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-05T14:16:35.072478Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-05T14:22:08.4595362Z"},"properties":{"provisioningState":"Accepted","mobileNetwork":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002"}}}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/39e56758-dcea-4f28-b27d-34e276a1a327*E44602EE0F22E031208D6172F1F33263FAF762FFA2F33997B936F69200D4058E?api-version=2022-11-01 + cache-control: + - no-cache + content-length: + - '770' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 14:22:10 GMT + etag: + - '"8e035f3e-0000-0100-0000-63b6dd110000"' + expires: + - '-1' + mise-correlation-id: + - 50dc14cf-85aa-4dac-8002-cd15a429dbc1 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.1 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network sim group update + Connection: + - keep-alive + ParameterSetName: + - -n -g --tags + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/39e56758-dcea-4f28-b27d-34e276a1a327*E44602EE0F22E031208D6172F1F33263FAF762FFA2F33997B936F69200D4058E?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/39e56758-dcea-4f28-b27d-34e276a1a327*E44602EE0F22E031208D6172F1F33263FAF762FFA2F33997B936F69200D4058E","name":"39e56758-dcea-4f28-b27d-34e276a1a327*E44602EE0F22E031208D6172F1F33263FAF762FFA2F33997B936F69200D4058E","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/simGroups/simgroup000003","status":"Accepted","startTime":"2023-01-05T14:22:08.9409116Z"}' + headers: + cache-control: + - no-cache + content-length: + - '525' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 14:22:40 GMT + etag: + - '"9e005b3e-0000-0100-0000-63b6dd100000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network sim group update + Connection: + - keep-alive + ParameterSetName: + - -n -g --tags + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/39e56758-dcea-4f28-b27d-34e276a1a327*E44602EE0F22E031208D6172F1F33263FAF762FFA2F33997B936F69200D4058E?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/39e56758-dcea-4f28-b27d-34e276a1a327*E44602EE0F22E031208D6172F1F33263FAF762FFA2F33997B936F69200D4058E","name":"39e56758-dcea-4f28-b27d-34e276a1a327*E44602EE0F22E031208D6172F1F33263FAF762FFA2F33997B936F69200D4058E","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/simGroups/simgroup000003","status":"Accepted","startTime":"2023-01-05T14:22:08.9409116Z"}' + headers: + cache-control: + - no-cache + content-length: + - '525' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 14:23:11 GMT + etag: + - '"9e005b3e-0000-0100-0000-63b6dd100000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network sim group update + Connection: + - keep-alive + ParameterSetName: + - -n -g --tags + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/39e56758-dcea-4f28-b27d-34e276a1a327*E44602EE0F22E031208D6172F1F33263FAF762FFA2F33997B936F69200D4058E?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/39e56758-dcea-4f28-b27d-34e276a1a327*E44602EE0F22E031208D6172F1F33263FAF762FFA2F33997B936F69200D4058E","name":"39e56758-dcea-4f28-b27d-34e276a1a327*E44602EE0F22E031208D6172F1F33263FAF762FFA2F33997B936F69200D4058E","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/simGroups/simgroup000003","status":"Succeeded","startTime":"2023-01-05T14:22:08.9409116Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - '544' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 14:23:41 GMT + etag: + - '"9e00cb3e-0000-0100-0000-63b6dd530000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network sim group update + Connection: + - keep-alive + ParameterSetName: + - -n -g --tags + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/simGroups/simgroup000003?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/simGroups/simgroup000003","name":"simgroup000003","type":"microsoft.mobilenetwork/simgroups","location":"eastus","tags":{"tag":"test","tag2":"test2"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-05T14:16:35.072478Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-05T14:22:08.4595362Z"},"properties":{"provisioningState":"Succeeded","mobileNetwork":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002"}}}' + headers: + cache-control: + - no-cache + content-length: + - '771' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 14:23:42 GMT + etag: + - '"8e03c13e-0000-0100-0000-63b6dd170000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network sim group list + Connection: + - keep-alive + ParameterSetName: + - -g + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/simGroups?api-version=2022-11-01 + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/simGroups/simgroup000003","name":"simgroup000003","type":"microsoft.mobilenetwork/simgroups","location":"eastus","tags":{"tag":"test","tag2":"test2"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-05T14:16:35.072478Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-05T14:22:08.4595362Z"},"properties":{"provisioningState":"Succeeded","mobileNetwork":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002"}}}]}' + headers: + cache-control: + - no-cache + content-length: + - '783' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 14:23:44 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-original-request-ids: + - 94b49b5f-ecf9-4f30-86a9-dfc161757850 + - 6fc3fc5f-add7-4cef-b11d-856ac164a55c + - e980bb76-b740-4447-bbd5-3253e6913aff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network sim group show + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/simGroups/simgroup000003?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/simGroups/simgroup000003","name":"simgroup000003","type":"microsoft.mobilenetwork/simgroups","location":"eastus","tags":{"tag":"test","tag2":"test2"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-05T14:16:35.072478Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-05T14:22:08.4595362Z"},"properties":{"provisioningState":"Succeeded","mobileNetwork":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002"}}}' + headers: + cache-control: + - no-cache + content-length: + - '771' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 14:23:47 GMT + etag: + - '"8e03c13e-0000-0100-0000-63b6dd170000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: '{"properties": {"authenticationKey": "00000000000000000000000000000000", + "internationalMobileSubscriberIdentity": "0000000000", "operatorKeyCode": "00000000000000000000000000000000"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network sim create + Connection: + - keep-alive + Content-Length: + - '183' + Content-Type: + - application/json + ParameterSetName: + - -g --sim-group-name -n --international-msi --operator-key-code --authentication-key + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/simGroups/simgroup000003/sims/sim000004?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/simGroups/simgroup000003/sims/sim000004","name":"sim000004","type":"microsoft.mobilenetwork/simgroups/sims","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-05T14:23:48.9951262Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-05T14:23:48.9951262Z"},"properties":{"provisioningState":"Accepted","simState":"Disabled","internationalMobileSubscriberIdentity":"0000000000"}}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/d0cf6fdf-d4a7-48c9-bc25-367ad0b841b9*41361D2990EC38930DCD5987EBD02A3E0AD36796B69BE81182DF8D2D2EEA5881?api-version=2022-11-01 + cache-control: + - no-cache + content-length: + - '611' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 14:23:49 GMT + expires: + - '-1' + mise-correlation-id: + - d41250aa-63ac-4023-b52e-b11df3fb3232 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.1 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network sim create + Connection: + - keep-alive + ParameterSetName: + - -g --sim-group-name -n --international-msi --operator-key-code --authentication-key + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/d0cf6fdf-d4a7-48c9-bc25-367ad0b841b9*41361D2990EC38930DCD5987EBD02A3E0AD36796B69BE81182DF8D2D2EEA5881?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/d0cf6fdf-d4a7-48c9-bc25-367ad0b841b9*41361D2990EC38930DCD5987EBD02A3E0AD36796B69BE81182DF8D2D2EEA5881","name":"d0cf6fdf-d4a7-48c9-bc25-367ad0b841b9*41361D2990EC38930DCD5987EBD02A3E0AD36796B69BE81182DF8D2D2EEA5881","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/simGroups/simgroup000003/sims/sim000004","status":"Succeeded","startTime":"2023-01-05T14:23:50.0881816Z","endTime":"2023-01-05T14:23:50.7891456Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - '600' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 14:24:20 GMT + etag: + - '"9e001d3f-0000-0100-0000-63b6dd760000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network sim create + Connection: + - keep-alive + ParameterSetName: + - -g --sim-group-name -n --international-msi --operator-key-code --authentication-key + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/simGroups/simgroup000003/sims/sim000004?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_mobile_network000001/providers/microsoft.mobilenetwork/simgroups/simgroup000003/sims/sim000004","name":"sim000004","type":"microsoft.mobilenetwork/simgroups/sims","properties":{"provisioningState":"Succeeded","simState":"Disabled","internationalMobileSubscriberIdentity":"0000000000"}}' + headers: + cache-control: + - no-cache + content-length: + - '368' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 14:24:21 GMT + expires: + - '-1' + mise-correlation-id: + - 0d011953-0e70-4bda-ba41-495c984d967a + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.1 + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network sim list + Connection: + - keep-alive + ParameterSetName: + - -g --sim-group-name + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/simGroups/simgroup000003/sims?api-version=2022-11-01 + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_mobile_network000001/providers/microsoft.mobilenetwork/simgroups/simgroup000003/sims/sim000004","name":"sim000004","type":"microsoft.mobilenetwork/simgroups/sims","properties":{"provisioningState":"Succeeded","simState":"Disabled","internationalMobileSubscriberIdentity":"0000000000"}}]}' + headers: + cache-control: + - no-cache + content-length: + - '380' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 14:24:23 GMT + expires: + - '-1' + mise-correlation-id: + - 73a88cae-34f5-4b98-8500-c309b0c69a81 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.1 + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network sim show + Connection: + - keep-alive + ParameterSetName: + - -g -n --sim-group-name + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/simGroups/simgroup000003/sims/sim000004?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_mobile_network000001/providers/microsoft.mobilenetwork/simgroups/simgroup000003/sims/sim000004","name":"sim000004","type":"microsoft.mobilenetwork/simgroups/sims","properties":{"provisioningState":"Succeeded","simState":"Disabled","internationalMobileSubscriberIdentity":"0000000000"}}' + headers: + cache-control: + - no-cache + content-length: + - '368' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 14:24:23 GMT + expires: + - '-1' + mise-correlation-id: + - d1a3c910-ea42-440b-b62b-dcf0223d34ad + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.1 + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network sim delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -g -n --sim-group-name -y + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/simGroups/simgroup000003/sims/sim000004?api-version=2022-11-01 + response: + body: + string: 'null' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/dce50565-4cf6-4524-9bad-5f348fe2f2a5*41361D2990EC38930DCD5987EBD02A3E0AD36796B69BE81182DF8D2D2EEA5881?api-version=2022-11-01 + cache-control: + - no-cache + content-length: + - '4' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 14:24:24 GMT + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/dce50565-4cf6-4524-9bad-5f348fe2f2a5*41361D2990EC38930DCD5987EBD02A3E0AD36796B69BE81182DF8D2D2EEA5881?api-version=2022-11-01 + mise-correlation-id: + - ea0f8f89-821c-4125-a6a7-f3fac0c3f74a + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.1 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network sim delete + Connection: + - keep-alive + ParameterSetName: + - -g -n --sim-group-name -y + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/dce50565-4cf6-4524-9bad-5f348fe2f2a5*41361D2990EC38930DCD5987EBD02A3E0AD36796B69BE81182DF8D2D2EEA5881?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/dce50565-4cf6-4524-9bad-5f348fe2f2a5*41361D2990EC38930DCD5987EBD02A3E0AD36796B69BE81182DF8D2D2EEA5881","name":"dce50565-4cf6-4524-9bad-5f348fe2f2a5*41361D2990EC38930DCD5987EBD02A3E0AD36796B69BE81182DF8D2D2EEA5881","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/simGroups/simgroup000003/sims/sim000004","status":"Succeeded","startTime":"2023-01-05T14:24:24.8961663Z","endTime":"2023-01-05T14:24:25.6264007Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - '600' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 14:24:55 GMT + etag: + - '"9e00833f-0000-0100-0000-63b6dd990000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network sim delete + Connection: + - keep-alive + ParameterSetName: + - -g -n --sim-group-name -y + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/dce50565-4cf6-4524-9bad-5f348fe2f2a5*41361D2990EC38930DCD5987EBD02A3E0AD36796B69BE81182DF8D2D2EEA5881?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/dce50565-4cf6-4524-9bad-5f348fe2f2a5*41361D2990EC38930DCD5987EBD02A3E0AD36796B69BE81182DF8D2D2EEA5881","name":"dce50565-4cf6-4524-9bad-5f348fe2f2a5*41361D2990EC38930DCD5987EBD02A3E0AD36796B69BE81182DF8D2D2EEA5881","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/simGroups/simgroup000003/sims/sim000004","status":"Succeeded","startTime":"2023-01-05T14:24:24.8961663Z","endTime":"2023-01-05T14:24:25.6264007Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - '600' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 14:24:55 GMT + etag: + - '"9e00833f-0000-0100-0000-63b6dd990000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network sim group delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -n -g -y + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/simGroups/simgroup000003?api-version=2022-11-01 + response: + body: + string: 'null' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/861907f1-611b-49f2-92e4-2e758563c9e4*E44602EE0F22E031208D6172F1F33263FAF762FFA2F33997B936F69200D4058E?api-version=2022-11-01 + cache-control: + - no-cache + content-length: + - '4' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 14:24:57 GMT + etag: + - '"8e034c41-0000-0100-0000-63b6ddb90000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/861907f1-611b-49f2-92e4-2e758563c9e4*E44602EE0F22E031208D6172F1F33263FAF762FFA2F33997B936F69200D4058E?api-version=2022-11-01 + mise-correlation-id: + - 20732f02-f0ff-4b3c-b3f4-1db07841da66 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.1 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network sim group delete + Connection: + - keep-alive + ParameterSetName: + - -n -g -y + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/861907f1-611b-49f2-92e4-2e758563c9e4*E44602EE0F22E031208D6172F1F33263FAF762FFA2F33997B936F69200D4058E?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/861907f1-611b-49f2-92e4-2e758563c9e4*E44602EE0F22E031208D6172F1F33263FAF762FFA2F33997B936F69200D4058E","name":"861907f1-611b-49f2-92e4-2e758563c9e4*E44602EE0F22E031208D6172F1F33263FAF762FFA2F33997B936F69200D4058E","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/simGroups/simgroup000003","status":"Deleting","startTime":"2023-01-05T14:24:57.2132915Z"}' + headers: + cache-control: + - no-cache + content-length: + - '525' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 14:25:27 GMT + etag: + - '"9e00d53f-0000-0100-0000-63b6ddb90000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network sim group delete + Connection: + - keep-alive + ParameterSetName: + - -n -g -y + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/861907f1-611b-49f2-92e4-2e758563c9e4*E44602EE0F22E031208D6172F1F33263FAF762FFA2F33997B936F69200D4058E?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/861907f1-611b-49f2-92e4-2e758563c9e4*E44602EE0F22E031208D6172F1F33263FAF762FFA2F33997B936F69200D4058E","name":"861907f1-611b-49f2-92e4-2e758563c9e4*E44602EE0F22E031208D6172F1F33263FAF762FFA2F33997B936F69200D4058E","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/simGroups/simgroup000003","status":"Deleting","startTime":"2023-01-05T14:24:57.2132915Z"}' + headers: + cache-control: + - no-cache + content-length: + - '525' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 14:25:57 GMT + etag: + - '"9e00d53f-0000-0100-0000-63b6ddb90000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network sim group delete + Connection: + - keep-alive + ParameterSetName: + - -n -g -y + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/861907f1-611b-49f2-92e4-2e758563c9e4*E44602EE0F22E031208D6172F1F33263FAF762FFA2F33997B936F69200D4058E?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/861907f1-611b-49f2-92e4-2e758563c9e4*E44602EE0F22E031208D6172F1F33263FAF762FFA2F33997B936F69200D4058E","name":"861907f1-611b-49f2-92e4-2e758563c9e4*E44602EE0F22E031208D6172F1F33263FAF762FFA2F33997B936F69200D4058E","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/simGroups/simgroup000003","status":"Succeeded","startTime":"2023-01-05T14:24:57.2132915Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - '544' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 14:26:28 GMT + etag: + - '"15003804-0000-0600-0000-63b6ddfb0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network sim group delete + Connection: + - keep-alive + ParameterSetName: + - -n -g -y + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/861907f1-611b-49f2-92e4-2e758563c9e4*E44602EE0F22E031208D6172F1F33263FAF762FFA2F33997B936F69200D4058E?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/861907f1-611b-49f2-92e4-2e758563c9e4*E44602EE0F22E031208D6172F1F33263FAF762FFA2F33997B936F69200D4058E","name":"861907f1-611b-49f2-92e4-2e758563c9e4*E44602EE0F22E031208D6172F1F33263FAF762FFA2F33997B936F69200D4058E","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/simGroups/simgroup000003","status":"Succeeded","startTime":"2023-01-05T14:24:57.2132915Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - '544' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 14:26:28 GMT + etag: + - '"15003804-0000-0600-0000-63b6ddfb0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/src/mobile-network/azext_mobile_network/tests/latest/recordings/test_mobile_network_site.yaml b/src/mobile-network/azext_mobile_network/tests/latest/recordings/test_mobile_network_site.yaml new file mode 100644 index 00000000000..fcb4c4bcfdf --- /dev/null +++ b/src/mobile-network/azext_mobile_network/tests/latest/recordings/test_mobile_network_site.yaml @@ -0,0 +1,552 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network create + Connection: + - keep-alive + ParameterSetName: + - -n -g --identifier + User-Agent: + - AZURECLI/2.43.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_mobile_network000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001","name":"cli_test_mobile_network000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2023-01-04T02:17:09Z","StorageType":"Standard_LRS","type":"test"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '379' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 04 Jan 2023 02:17:18 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus", "properties": {"publicLandMobileNetworkIdentifier": + {"mcc": "001", "mnc": "01"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network create + Connection: + - keep-alive + Content-Length: + - '104' + Content-Type: + - application/json + ParameterSetName: + - -n -g --identifier + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002","name":"mobile_network_000002","type":"microsoft.mobilenetwork/mobilenetworks","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-04T02:17:22.4825052Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-04T02:17:22.4825052Z"},"properties":{"provisioningState":"Succeeded","publicLandMobileNetworkIdentifier":{"mcc":"001","mnc":"01"},"serviceKey":"cb0cc684-30ab-435e-9d6e-80c7cc714817"}}' + headers: + cache-control: + - no-cache + content-length: + - '679' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 04 Jan 2023 02:17:23 GMT + etag: + - '"8e00025a-0000-0100-0000-63b4e1b30000"' + expires: + - '-1' + mise-correlation-id: + - 4bf93915-2ed3-4695-84e9-bd1fce87e9d7 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.1 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network site create + Connection: + - keep-alive + ParameterSetName: + - --mobile-network-name -n -g + User-Agent: + - AZURECLI/2.43.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_mobile_network000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001","name":"cli_test_mobile_network000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2023-01-04T02:17:09Z","StorageType":"Standard_LRS","type":"test"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '379' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 04 Jan 2023 02:17:24 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network site create + Connection: + - keep-alive + Content-Length: + - '22' + Content-Type: + - application/json + ParameterSetName: + - --mobile-network-name -n -g + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/sites/site_000003?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/sites/site_000003","name":"site_000003","type":"microsoft.mobilenetwork/mobilenetworks/sites","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-04T02:17:28.0557856Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-04T02:17:28.0557856Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '580' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 04 Jan 2023 02:17:28 GMT + etag: + - '"e3005190-0000-0100-0000-63b4e1b80000"' + expires: + - '-1' + mise-correlation-id: + - 3dfb645b-86b6-45ab-a53a-b59d757e6cef + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.1 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network site update + Connection: + - keep-alive + ParameterSetName: + - --mobile-network-name -n -g --tags + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/sites/site_000003?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/sites/site_000003","name":"site_000003","type":"microsoft.mobilenetwork/mobilenetworks/sites","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-04T02:17:28.0557856Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-04T02:17:28.0557856Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '580' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 04 Jan 2023 02:17:30 GMT + etag: + - '"e3005190-0000-0100-0000-63b4e1b80000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus", "properties": {}, "tags": {"tag": "test", "tag2": + "test2"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network site update + Connection: + - keep-alive + Content-Length: + - '82' + Content-Type: + - application/json + ParameterSetName: + - --mobile-network-name -n -g --tags + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/sites/site_000003?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/sites/site_000003","name":"site_000003","type":"microsoft.mobilenetwork/mobilenetworks/sites","location":"eastus","tags":{"tag":"test","tag2":"test2"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-04T02:17:28.0557856Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-04T02:17:32.5426586Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '617' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 04 Jan 2023 02:17:34 GMT + etag: + - '"e3009d90-0000-0100-0000-63b4e1bc0000"' + expires: + - '-1' + mise-correlation-id: + - 602192ce-b7d8-40cd-8721-1f39b76099a0 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.1 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network site list + Connection: + - keep-alive + ParameterSetName: + - --mobile-network-name -g + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/sites?api-version=2022-11-01 + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/sites/site_000003","name":"site_000003","type":"microsoft.mobilenetwork/mobilenetworks/sites","location":"eastus","tags":{"tag":"test","tag2":"test2"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-04T02:17:28.0557856Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-04T02:17:32.5426586Z"},"properties":{"provisioningState":"Succeeded"}}]}' + headers: + cache-control: + - no-cache + content-length: + - '629' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 04 Jan 2023 02:17:36 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-original-request-ids: + - 7d05cd54-47d4-4ba3-a01b-47fd04705a13 + - df344536-0e62-4586-ad54-e6d6bd2107fd + - 1354aa41-fdaa-4721-8ae7-d008797b45bd + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network site show + Connection: + - keep-alive + ParameterSetName: + - --mobile-network-name -n -g + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/sites/site_000003?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/sites/site_000003","name":"site_000003","type":"microsoft.mobilenetwork/mobilenetworks/sites","location":"eastus","tags":{"tag":"test","tag2":"test2"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-04T02:17:28.0557856Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-04T02:17:32.5426586Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '617' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 04 Jan 2023 02:17:37 GMT + etag: + - '"e3009d90-0000-0100-0000-63b4e1bc0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network site delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --mobile-network-name -n -g -y + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/sites/site_000003?api-version=2022-11-01 + response: + body: + string: 'null' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/b86ce6b2-5c85-4844-8965-76eb1ef6bdc8*205F576FD66B66AD7F0F9E231A6681FBA737D9640B514EB93669AEE7E88B4B74?api-version=2022-11-01 + cache-control: + - no-cache + content-length: + - '4' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 04 Jan 2023 02:17:40 GMT + etag: + - '"e3006891-0000-0100-0000-63b4e1c40000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/b86ce6b2-5c85-4844-8965-76eb1ef6bdc8*205F576FD66B66AD7F0F9E231A6681FBA737D9640B514EB93669AEE7E88B4B74?api-version=2022-11-01 + mise-correlation-id: + - 37722a27-e498-41df-a987-f19544373d75 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.1 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-deletes: + - '14998' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network site delete + Connection: + - keep-alive + ParameterSetName: + - --mobile-network-name -n -g -y + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/b86ce6b2-5c85-4844-8965-76eb1ef6bdc8*205F576FD66B66AD7F0F9E231A6681FBA737D9640B514EB93669AEE7E88B4B74?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/b86ce6b2-5c85-4844-8965-76eb1ef6bdc8*205F576FD66B66AD7F0F9E231A6681FBA737D9640B514EB93669AEE7E88B4B74","name":"b86ce6b2-5c85-4844-8965-76eb1ef6bdc8*205F576FD66B66AD7F0F9E231A6681FBA737D9640B514EB93669AEE7E88B4B74","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/sites/site_000003","status":"Succeeded","startTime":"2023-01-04T02:17:40.7284072Z","endTime":"2023-01-04T02:17:44.0505257Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - '615' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 04 Jan 2023 02:18:10 GMT + etag: + - '"9a00d813-0000-0100-0000-63b4e1c80000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network site delete + Connection: + - keep-alive + ParameterSetName: + - --mobile-network-name -n -g -y + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/b86ce6b2-5c85-4844-8965-76eb1ef6bdc8*205F576FD66B66AD7F0F9E231A6681FBA737D9640B514EB93669AEE7E88B4B74?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/b86ce6b2-5c85-4844-8965-76eb1ef6bdc8*205F576FD66B66AD7F0F9E231A6681FBA737D9640B514EB93669AEE7E88B4B74","name":"b86ce6b2-5c85-4844-8965-76eb1ef6bdc8*205F576FD66B66AD7F0F9E231A6681FBA737D9640B514EB93669AEE7E88B4B74","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/sites/site_000003","status":"Succeeded","startTime":"2023-01-04T02:17:40.7284072Z","endTime":"2023-01-04T02:17:44.0505257Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - '615' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 04 Jan 2023 02:18:10 GMT + etag: + - '"9a00d813-0000-0100-0000-63b4e1c80000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/src/mobile-network/azext_mobile_network/tests/latest/recordings/test_mobile_network_slice.yaml b/src/mobile-network/azext_mobile_network/tests/latest/recordings/test_mobile_network_slice.yaml new file mode 100644 index 00000000000..5fe89d82629 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/tests/latest/recordings/test_mobile_network_slice.yaml @@ -0,0 +1,999 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network create + Connection: + - keep-alive + ParameterSetName: + - -n -g --identifier + User-Agent: + - AZURECLI/2.43.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_mobile_network000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001","name":"cli_test_mobile_network000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2023-01-05T14:53:45Z","StorageType":"Standard_LRS","type":"test"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '379' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 14:53:58 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus", "properties": {"publicLandMobileNetworkIdentifier": + {"mcc": "001", "mnc": "01"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network create + Connection: + - keep-alive + Content-Length: + - '104' + Content-Type: + - application/json + ParameterSetName: + - -n -g --identifier + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002","name":"mobile_network_000002","type":"microsoft.mobilenetwork/mobilenetworks","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-05T14:54:04.3148188Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-05T14:54:04.3148188Z"},"properties":{"provisioningState":"Succeeded","publicLandMobileNetworkIdentifier":{"mcc":"001","mnc":"01"},"serviceKey":"9cebf7e2-b090-4be2-8267-ba44077a1f16"}}' + headers: + cache-control: + - no-cache + content-length: + - '679' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 14:54:05 GMT + etag: + - '"a2007b17-0000-0100-0000-63b6e48d0000"' + expires: + - '-1' + mise-correlation-id: + - e4ccb987-3b22-42ba-8b0f-e34a2c0e2253 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.1 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network slice create + Connection: + - keep-alive + ParameterSetName: + - --mobile-network-name -n -g --snssai + User-Agent: + - AZURECLI/2.43.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_mobile_network000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001","name":"cli_test_mobile_network000001","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"product":"azurecli","cause":"automation","date":"2023-01-05T14:53:45Z","StorageType":"Standard_LRS","type":"test"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '379' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 14:54:07 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus", "properties": {"snssai": {"sd": "123abc", "sst": + 1}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network slice create + Connection: + - keep-alive + Content-Length: + - '76' + Content-Type: + - application/json + ParameterSetName: + - --mobile-network-name -n -g --snssai + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/slices/slice000003?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/slices/slice000003","name":"slice000003","type":"microsoft.mobilenetwork/mobilenetworks/slices","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-05T14:54:12.6159385Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-05T14:54:12.6159385Z"},"properties":{"snssai":{"sd":"123abc","sst":1},"provisioningState":"Accepted"}}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/d6dceee5-2604-405e-8c5b-37ff05c57a06*C2D2F86E0A4821348063B8D19D2D397F3195DA99EC348B3DCE7D5C65CF420676?api-version=2022-11-01 + cache-control: + - no-cache + content-length: + - '614' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 14:54:14 GMT + etag: + - '"1b00c6ef-0000-0100-0000-63b6e4960000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.1 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network slice create + Connection: + - keep-alive + ParameterSetName: + - --mobile-network-name -n -g --snssai + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/d6dceee5-2604-405e-8c5b-37ff05c57a06*C2D2F86E0A4821348063B8D19D2D397F3195DA99EC348B3DCE7D5C65CF420676?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/d6dceee5-2604-405e-8c5b-37ff05c57a06*C2D2F86E0A4821348063B8D19D2D397F3195DA99EC348B3DCE7D5C65CF420676","name":"d6dceee5-2604-405e-8c5b-37ff05c57a06*C2D2F86E0A4821348063B8D19D2D397F3195DA99EC348B3DCE7D5C65CF420676","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/slices/slice000003","status":"Accepted","startTime":"2023-01-05T14:54:13.6941996Z"}' + headers: + cache-control: + - no-cache + content-length: + - '556' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 14:54:45 GMT + etag: + - '"9e004049-0000-0100-0000-63b6e4950000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network slice create + Connection: + - keep-alive + ParameterSetName: + - --mobile-network-name -n -g --snssai + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/d6dceee5-2604-405e-8c5b-37ff05c57a06*C2D2F86E0A4821348063B8D19D2D397F3195DA99EC348B3DCE7D5C65CF420676?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/d6dceee5-2604-405e-8c5b-37ff05c57a06*C2D2F86E0A4821348063B8D19D2D397F3195DA99EC348B3DCE7D5C65CF420676","name":"d6dceee5-2604-405e-8c5b-37ff05c57a06*C2D2F86E0A4821348063B8D19D2D397F3195DA99EC348B3DCE7D5C65CF420676","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/slices/slice000003","status":"Accepted","startTime":"2023-01-05T14:54:13.6941996Z"}' + headers: + cache-control: + - no-cache + content-length: + - '556' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 14:55:15 GMT + etag: + - '"9e004049-0000-0100-0000-63b6e4950000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network slice create + Connection: + - keep-alive + ParameterSetName: + - --mobile-network-name -n -g --snssai + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/d6dceee5-2604-405e-8c5b-37ff05c57a06*C2D2F86E0A4821348063B8D19D2D397F3195DA99EC348B3DCE7D5C65CF420676?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/d6dceee5-2604-405e-8c5b-37ff05c57a06*C2D2F86E0A4821348063B8D19D2D397F3195DA99EC348B3DCE7D5C65CF420676","name":"d6dceee5-2604-405e-8c5b-37ff05c57a06*C2D2F86E0A4821348063B8D19D2D397F3195DA99EC348B3DCE7D5C65CF420676","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/slices/slice000003","status":"Succeeded","startTime":"2023-01-05T14:54:13.6941996Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - '575' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 14:55:45 GMT + etag: + - '"9e00ad49-0000-0100-0000-63b6e4d80000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network slice create + Connection: + - keep-alive + ParameterSetName: + - --mobile-network-name -n -g --snssai + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/slices/slice000003?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/slices/slice000003","name":"slice000003","type":"microsoft.mobilenetwork/mobilenetworks/slices","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-05T14:54:12.6159385Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-05T14:54:12.6159385Z"},"properties":{"snssai":{"sd":"123abc","sst":1},"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '615' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 14:55:46 GMT + etag: + - '"1b00c7ef-0000-0100-0000-63b6e49e0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network slice update + Connection: + - keep-alive + ParameterSetName: + - --mobile-network-name -n -g --tags + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/slices/slice000003?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/slices/slice000003","name":"slice000003","type":"microsoft.mobilenetwork/mobilenetworks/slices","location":"eastus","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-05T14:54:12.6159385Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-05T14:54:12.6159385Z"},"properties":{"snssai":{"sd":"123abc","sst":1},"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '615' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 14:55:48 GMT + etag: + - '"1b00c7ef-0000-0100-0000-63b6e49e0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus", "properties": {"snssai": {"sd": "123abc", "sst": + 1}}, "tags": {"tag": "test", "tag2": "test2"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network slice update + Connection: + - keep-alive + Content-Length: + - '118' + Content-Type: + - application/json + ParameterSetName: + - --mobile-network-name -n -g --tags + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/slices/slice000003?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/slices/slice000003","name":"slice000003","type":"microsoft.mobilenetwork/mobilenetworks/slices","location":"eastus","tags":{"tag":"test","tag2":"test2"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-05T14:54:12.6159385Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-05T14:55:49.6741919Z"},"properties":{"provisioningState":"Accepted","snssai":{"sd":"123abc","sst":1}}}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/ab066c72-2778-43f0-a4e2-78e80ae402fb*C2D2F86E0A4821348063B8D19D2D397F3195DA99EC348B3DCE7D5C65CF420676?api-version=2022-11-01 + cache-control: + - no-cache + content-length: + - '651' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 14:55:52 GMT + etag: + - '"1b00eaef-0000-0100-0000-63b6e4f60000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.1 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1197' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network slice update + Connection: + - keep-alive + ParameterSetName: + - --mobile-network-name -n -g --tags + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/ab066c72-2778-43f0-a4e2-78e80ae402fb*C2D2F86E0A4821348063B8D19D2D397F3195DA99EC348B3DCE7D5C65CF420676?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/ab066c72-2778-43f0-a4e2-78e80ae402fb*C2D2F86E0A4821348063B8D19D2D397F3195DA99EC348B3DCE7D5C65CF420676","name":"ab066c72-2778-43f0-a4e2-78e80ae402fb*C2D2F86E0A4821348063B8D19D2D397F3195DA99EC348B3DCE7D5C65CF420676","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/slices/slice000003","status":"Accepted","startTime":"2023-01-05T14:55:50.2905796Z"}' + headers: + cache-control: + - no-cache + content-length: + - '556' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 14:56:23 GMT + etag: + - '"9e00c049-0000-0100-0000-63b6e4f60000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network slice update + Connection: + - keep-alive + ParameterSetName: + - --mobile-network-name -n -g --tags + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/ab066c72-2778-43f0-a4e2-78e80ae402fb*C2D2F86E0A4821348063B8D19D2D397F3195DA99EC348B3DCE7D5C65CF420676?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/ab066c72-2778-43f0-a4e2-78e80ae402fb*C2D2F86E0A4821348063B8D19D2D397F3195DA99EC348B3DCE7D5C65CF420676","name":"ab066c72-2778-43f0-a4e2-78e80ae402fb*C2D2F86E0A4821348063B8D19D2D397F3195DA99EC348B3DCE7D5C65CF420676","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/slices/slice000003","status":"Accepted","startTime":"2023-01-05T14:55:50.2905796Z"}' + headers: + cache-control: + - no-cache + content-length: + - '556' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 14:56:52 GMT + etag: + - '"9e00c049-0000-0100-0000-63b6e4f60000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network slice update + Connection: + - keep-alive + ParameterSetName: + - --mobile-network-name -n -g --tags + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/ab066c72-2778-43f0-a4e2-78e80ae402fb*C2D2F86E0A4821348063B8D19D2D397F3195DA99EC348B3DCE7D5C65CF420676?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/ab066c72-2778-43f0-a4e2-78e80ae402fb*C2D2F86E0A4821348063B8D19D2D397F3195DA99EC348B3DCE7D5C65CF420676","name":"ab066c72-2778-43f0-a4e2-78e80ae402fb*C2D2F86E0A4821348063B8D19D2D397F3195DA99EC348B3DCE7D5C65CF420676","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/slices/slice000003","status":"Succeeded","startTime":"2023-01-05T14:55:50.2905796Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - '575' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 14:57:22 GMT + etag: + - '"9e00214a-0000-0100-0000-63b6e5380000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network slice update + Connection: + - keep-alive + ParameterSetName: + - --mobile-network-name -n -g --tags + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/slices/slice000003?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/slices/slice000003","name":"slice000003","type":"microsoft.mobilenetwork/mobilenetworks/slices","location":"eastus","tags":{"tag":"test","tag2":"test2"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-05T14:54:12.6159385Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-05T14:55:49.6741919Z"},"properties":{"provisioningState":"Succeeded","snssai":{"sd":"123abc","sst":1}}}' + headers: + cache-control: + - no-cache + content-length: + - '652' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 14:57:23 GMT + etag: + - '"1b00f8ef-0000-0100-0000-63b6e4fe0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network slice list + Connection: + - keep-alive + ParameterSetName: + - --mobile-network-name -g + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/slices?api-version=2022-11-01 + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/slices/slice000003","name":"slice000003","type":"microsoft.mobilenetwork/mobilenetworks/slices","location":"eastus","tags":{"tag":"test","tag2":"test2"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-05T14:54:12.6159385Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-05T14:55:49.6741919Z"},"properties":{"provisioningState":"Succeeded","snssai":{"sd":"123abc","sst":1}}}]}' + headers: + cache-control: + - no-cache + content-length: + - '664' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 14:57:25 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-original-request-ids: + - 1df8c9e6-dd33-4743-869f-96995626b62a + - e929fb28-dd89-4a74-a676-c38b4f94f316 + - 75f2c2e1-d594-4ffd-b86d-3579074717cb + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network slice show + Connection: + - keep-alive + ParameterSetName: + - --mobile-network-name -n -g + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/slices/slice000003?api-version=2022-11-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/slices/slice000003","name":"slice000003","type":"microsoft.mobilenetwork/mobilenetworks/slices","location":"eastus","tags":{"tag":"test","tag2":"test2"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-01-05T14:54:12.6159385Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-01-05T14:55:49.6741919Z"},"properties":{"provisioningState":"Succeeded","snssai":{"sd":"123abc","sst":1}}}' + headers: + cache-control: + - no-cache + content-length: + - '652' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 14:57:29 GMT + etag: + - '"1b00f8ef-0000-0100-0000-63b6e4fe0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network slice delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --mobile-network-name -n -g -y + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/slices/slice000003?api-version=2022-11-01 + response: + body: + string: 'null' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/1c7da751-d84d-4467-b4f2-db696d804d00*C2D2F86E0A4821348063B8D19D2D397F3195DA99EC348B3DCE7D5C65CF420676?api-version=2022-11-01 + cache-control: + - no-cache + content-length: + - '4' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 14:57:33 GMT + etag: + - '"1b000ff0-0000-0100-0000-63b6e55d0000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/1c7da751-d84d-4467-b4f2-db696d804d00*C2D2F86E0A4821348063B8D19D2D397F3195DA99EC348B3DCE7D5C65CF420676?api-version=2022-11-01 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.1 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network slice delete + Connection: + - keep-alive + ParameterSetName: + - --mobile-network-name -n -g -y + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/1c7da751-d84d-4467-b4f2-db696d804d00*C2D2F86E0A4821348063B8D19D2D397F3195DA99EC348B3DCE7D5C65CF420676?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/1c7da751-d84d-4467-b4f2-db696d804d00*C2D2F86E0A4821348063B8D19D2D397F3195DA99EC348B3DCE7D5C65CF420676","name":"1c7da751-d84d-4467-b4f2-db696d804d00*C2D2F86E0A4821348063B8D19D2D397F3195DA99EC348B3DCE7D5C65CF420676","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/slices/slice000003","status":"Deleting","startTime":"2023-01-05T14:57:32.7199437Z"}' + headers: + cache-control: + - no-cache + content-length: + - '556' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 14:58:02 GMT + etag: + - '"9e00254a-0000-0100-0000-63b6e55c0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network slice delete + Connection: + - keep-alive + ParameterSetName: + - --mobile-network-name -n -g -y + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/1c7da751-d84d-4467-b4f2-db696d804d00*C2D2F86E0A4821348063B8D19D2D397F3195DA99EC348B3DCE7D5C65CF420676?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/1c7da751-d84d-4467-b4f2-db696d804d00*C2D2F86E0A4821348063B8D19D2D397F3195DA99EC348B3DCE7D5C65CF420676","name":"1c7da751-d84d-4467-b4f2-db696d804d00*C2D2F86E0A4821348063B8D19D2D397F3195DA99EC348B3DCE7D5C65CF420676","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/slices/slice000003","status":"Deleting","startTime":"2023-01-05T14:57:32.7199437Z"}' + headers: + cache-control: + - no-cache + content-length: + - '556' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 14:58:33 GMT + etag: + - '"9e00254a-0000-0100-0000-63b6e55c0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network slice delete + Connection: + - keep-alive + ParameterSetName: + - --mobile-network-name -n -g -y + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/1c7da751-d84d-4467-b4f2-db696d804d00*C2D2F86E0A4821348063B8D19D2D397F3195DA99EC348B3DCE7D5C65CF420676?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/1c7da751-d84d-4467-b4f2-db696d804d00*C2D2F86E0A4821348063B8D19D2D397F3195DA99EC348B3DCE7D5C65CF420676","name":"1c7da751-d84d-4467-b4f2-db696d804d00*C2D2F86E0A4821348063B8D19D2D397F3195DA99EC348B3DCE7D5C65CF420676","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/slices/slice000003","status":"Succeeded","startTime":"2023-01-05T14:57:32.7199437Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - '575' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 14:59:03 GMT + etag: + - '"1500aa0e-0000-0600-0000-63b6e59f0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - mobile-network slice delete + Connection: + - keep-alive + ParameterSetName: + - --mobile-network-name -n -g -y + User-Agent: + - AZURECLI/2.43.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/1c7da751-d84d-4467-b4f2-db696d804d00*C2D2F86E0A4821348063B8D19D2D397F3195DA99EC348B3DCE7D5C65CF420676?api-version=2022-11-01 + response: + body: + string: '{"id":"/providers/Microsoft.MobileNetwork/locations/EASTUS/operationStatuses/1c7da751-d84d-4467-b4f2-db696d804d00*C2D2F86E0A4821348063B8D19D2D397F3195DA99EC348B3DCE7D5C65CF420676","name":"1c7da751-d84d-4467-b4f2-db696d804d00*C2D2F86E0A4821348063B8D19D2D397F3195DA99EC348B3DCE7D5C65CF420676","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_mobile_network000001/providers/Microsoft.MobileNetwork/mobileNetworks/mobile_network_000002/slices/slice000003","status":"Succeeded","startTime":"2023-01-05T14:57:32.7199437Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - '575' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 05 Jan 2023 14:59:03 GMT + etag: + - '"1500aa0e-0000-0600-0000-63b6e59f0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/src/mobile-network/azext_mobile_network/tests/latest/test_mobile_network.py b/src/mobile-network/azext_mobile_network/tests/latest/test_mobile_network.py new file mode 100644 index 00000000000..a7f58769190 --- /dev/null +++ b/src/mobile-network/azext_mobile_network/tests/latest/test_mobile_network.py @@ -0,0 +1,444 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +from azure.cli.testsdk import * + + +class MobileNetworkScenario(ScenarioTest): + @ResourceGroupPreparer(name_prefix='cli_test_mobile_network', location='eastus') + def test_mobile_network(self, resource_group): + self.kwargs.update({ + 'mobile_network': self.create_random_name('mobile_network_', 20), + }) + self.cmd('mobile-network create -n {mobile_network} -g {rg} --identifier {{mcc:001,mnc:01}}', checks=[ + self.check('publicLandMobileNetworkIdentifier.mcc', '001'), + self.check('publicLandMobileNetworkIdentifier.mnc', '01') + ]) + self.cmd('mobile-network update -n {mobile_network} -g {rg} --tags {{tag:test,tag2:test2}}', checks=[ + self.check('tags.tag', 'test'), + self.check('tags.tag2', 'test2') + ]) + self.cmd('mobile-network list -g {rg}', checks=[ + self.check('[0].publicLandMobileNetworkIdentifier.mcc', '001'), + self.check('[0].publicLandMobileNetworkIdentifier.mnc', '01'), + self.check('[0].tags.tag', 'test'), + self.check('[0].tags.tag2', 'test2') + ]) + self.cmd('mobile-network show -n {mobile_network} -g {rg}', checks=[ + self.check('publicLandMobileNetworkIdentifier.mcc', '001'), + self.check('publicLandMobileNetworkIdentifier.mnc', '01'), + self.check('tags.tag', 'test'), + self.check('tags.tag2', 'test2') + ]) + self.cmd('mobile-network delete -n {mobile_network} -g {rg} -y') + + @ResourceGroupPreparer(name_prefix='cli_test_mobile_network', location='eastus') + def test_mobile_network_site(self, resource_group): + self.kwargs.update({ + 'mobile_network': self.create_random_name('mobile_network_', 20), + 'site_name': self.create_random_name('site_', 10) + }) + self.cmd('mobile-network create -n {mobile_network} -g {rg} --identifier {{mcc:001,mnc:01}}', checks=[ + self.check('publicLandMobileNetworkIdentifier.mcc', '001'), + self.check('publicLandMobileNetworkIdentifier.mnc', '01') + ]) + self.cmd('mobile-network site create --mobile-network-name {mobile_network} -n {site_name} -g {rg} ', checks=[ + self.check('name', '{site_name}'), + ]) + self.cmd('mobile-network site update --mobile-network-name {mobile_network} -n {site_name} -g {rg} --tags {{tag:test,tag2:test2}}', checks=[ + self.check('tags.tag', 'test'), + self.check('tags.tag2', 'test2') + ]) + self.cmd('mobile-network site list --mobile-network-name {mobile_network} -g {rg}', checks=[ + self.check('[0].tags.tag', 'test'), + self.check('[0].tags.tag2', 'test2') + ]) + self.cmd('mobile-network site show --mobile-network-name {mobile_network} -n {site_name} -g {rg}', checks=[ + self.check('tags.tag', 'test'), + self.check('tags.tag2', 'test2') + ]) + self.cmd('mobile-network site delete --mobile-network-name {mobile_network} -n {site_name} -g {rg} -y') + + @ResourceGroupPreparer(name_prefix='cli_test_mobile_network', location='eastus') + def test_mobile_network_pccp(self, resource_group): + self.kwargs.update({ + 'mobile_network': self.create_random_name('mobile_network_', 20), + 'site_name': self.create_random_name('site_', 10), + 'pccp_name': self.create_random_name('pccp_', 10) + }) + self.cmd('mobile-network create -n {mobile_network} -g {rg} --identifier {{mcc:001,mnc:01}}', checks=[ + self.check('publicLandMobileNetworkIdentifier.mcc', '001'), + self.check('publicLandMobileNetworkIdentifier.mnc', '01') + ]) + site = self.cmd('mobile-network site create --mobile-network-name {mobile_network} -n {site_name} -g {rg} ', checks=[ + self.check('name', '{site_name}'), + ]).get_output_in_json() + self.kwargs.update({ + 'site_id': site['id'] + }) + self.cmd('mobile-network pccp create -n {pccp_name} -g {rg} --access-interface {{name:N2,ipv4Address:10.28.128.2,ipv4Subnet:10.28.128.0/24,ipv4Gateway:10.28.128.1}} ' + '--local-diagnostics {{authentication-type:AAD}} --platform {{type:AKS-HCI}} ' + '--sites [{{id:{site_id}}}] --sku G0', checks=[ + self.check('controlPlaneAccessInterface.ipv4Address', '10.28.128.2'), + self.check('controlPlaneAccessInterface.ipv4Gateway', '10.28.128.1'), + self.check('controlPlaneAccessInterface.ipv4Subnet', '10.28.128.0/24'), + self.check('controlPlaneAccessInterface.name', 'N2'), + self.check('localDiagnosticsAccess.authenticationType', 'AAD'), + self.check('platform.type', 'AKS-HCI'), + self.check('name', '{pccp_name}'), + self.check('sku', 'G0'), + self.check('sites[0].id', '{site_id}') + ]) + self.cmd('mobile-network pccp update -n {pccp_name} -g {rg} --ue-mtu 1500 --tags {{tag:test,tag2:test2}}', checks=[ + self.check('ueMtu', '1500'), + self.check('tags.tag', 'test'), + self.check('tags.tag2', 'test2') + ]) + self.cmd('mobile-network pccp list -g {rg} ', checks=[ + self.check('[0].controlPlaneAccessInterface.ipv4Address', '10.28.128.2'), + self.check('[0].controlPlaneAccessInterface.ipv4Gateway', '10.28.128.1'), + self.check('[0].controlPlaneAccessInterface.ipv4Subnet', '10.28.128.0/24'), + self.check('[0].controlPlaneAccessInterface.name', 'N2'), + self.check('[0].localDiagnosticsAccess.authenticationType', 'AAD'), + self.check('[0].platform.type', 'AKS-HCI'), + self.check('[0].name', '{pccp_name}'), + self.check('[0].sku', 'G0'), + self.check('[0].ueMtu', '1500'), + ]) + self.cmd('mobile-network pccp show -n {pccp_name} -g {rg}', checks=[ + self.check('controlPlaneAccessInterface.ipv4Address', '10.28.128.2'), + self.check('controlPlaneAccessInterface.ipv4Gateway', '10.28.128.1'), + self.check('controlPlaneAccessInterface.ipv4Subnet', '10.28.128.0/24'), + self.check('controlPlaneAccessInterface.name', 'N2'), + self.check('localDiagnosticsAccess.authenticationType', 'AAD'), + self.check('platform.type', 'AKS-HCI'), + self.check('name', '{pccp_name}'), + self.check('sku', 'G0'), + self.check('ueMtu', '1500'), + self.check('tags.tag', 'test'), + self.check('tags.tag2', 'test2') + ]) + self.cmd('mobile-network pccp version list') + self.cmd('mobile-network pccp version show --version-name pmn-2211-0-80', checks=[ + self.check('name', 'pmn-2211-0-80') + ]) + self.cmd('mobile-network pccp delete -n {pccp_name} -g {rg} -y') + + @ResourceGroupPreparer(name_prefix='cli_test_mobile_network', location='eastus') + def test_mobile_network_pcdp(self, resource_group): + self.kwargs.update({ + 'mobile_network': self.create_random_name('mobile_network_', 20), + 'site_name': self.create_random_name('site_', 10), + 'pccp_name': self.create_random_name('pccp_', 10), + 'pcdp_name': self.create_random_name('pcdp_', 10), + }) + self.cmd('mobile-network create -n {mobile_network} -g {rg} --identifier {{mcc:001,mnc:01}}', checks=[ + self.check('publicLandMobileNetworkIdentifier.mcc', '001'), + self.check('publicLandMobileNetworkIdentifier.mnc', '01') + ]) + site = self.cmd('mobile-network site create --mobile-network-name {mobile_network} -n {site_name} -g {rg} ', checks=[ + self.check('name', '{site_name}'), + ]).get_output_in_json() + self.kwargs.update({ + 'site_id': site['id'] + }) + self.cmd('mobile-network pccp create -n {pccp_name} -g {rg} --access-interface {{name:N2,ipv4Address:10.28.128.2,ipv4Subnet:10.28.128.0/24,ipv4Gateway:10.28.128.1}} ' + '--local-diagnostics {{authentication-type:AAD}} --platform {{type:AKS-HCI}} ' + '--sites [{{id:{site_id}}}] --sku G0', checks=[ + self.check('controlPlaneAccessInterface.ipv4Address', '10.28.128.2'), + self.check('controlPlaneAccessInterface.ipv4Gateway', '10.28.128.1'), + self.check('controlPlaneAccessInterface.ipv4Subnet', '10.28.128.0/24'), + self.check('controlPlaneAccessInterface.name', 'N2'), + self.check('localDiagnosticsAccess.authenticationType', 'AAD'), + self.check('platform.type', 'AKS-HCI'), + self.check('name', '{pccp_name}'), + self.check('sku', 'G0'), + self.check('sites[0].id', '{site_id}') + ]) + self.cmd('mobile-network pcdp create -n {pcdp_name} -g {rg} --pccp-name {pccp_name} --access-interface {{name:N2,ipv4Address:10.28.128.2,ipv4Subnet:10.28.128.0/24,ipv4Gateway:10.28.128.1}}', checks=[ + self.check('userPlaneAccessInterface.ipv4Address', '10.28.128.2'), + self.check('userPlaneAccessInterface.ipv4Gateway', '10.28.128.1'), + self.check('userPlaneAccessInterface.ipv4Subnet', '10.28.128.0/24'), + self.check('userPlaneAccessInterface.name', 'N2') + ]) + self.cmd('mobile-network pcdp update -n {pcdp_name} -g {rg} --pccp-name {pccp_name} --tags {{tag:test,tag2:test2}}', checks=[ + self.check('userPlaneAccessInterface.ipv4Address', '10.28.128.2'), + self.check('userPlaneAccessInterface.ipv4Gateway', '10.28.128.1'), + self.check('userPlaneAccessInterface.ipv4Subnet', '10.28.128.0/24'), + self.check('userPlaneAccessInterface.name', 'N2'), + self.check('tags.tag', 'test'), + self.check('tags.tag2', 'test2') + ]) + self.cmd('mobile-network pcdp list -g {rg} --pccp-name {pccp_name}', checks=[ + self.check('[0].userPlaneAccessInterface.ipv4Address', '10.28.128.2'), + self.check('[0].userPlaneAccessInterface.ipv4Gateway', '10.28.128.1'), + self.check('[0].userPlaneAccessInterface.ipv4Subnet', '10.28.128.0/24'), + self.check('[0].userPlaneAccessInterface.name', 'N2'), + self.check('[0].tags.tag', 'test'), + self.check('[0].tags.tag2', 'test2') + ]) + self.cmd('mobile-network pcdp show -g {rg} -n {pcdp_name} --pccp-name {pccp_name}', checks=[ + self.check('userPlaneAccessInterface.ipv4Address', '10.28.128.2'), + self.check('userPlaneAccessInterface.ipv4Gateway', '10.28.128.1'), + self.check('userPlaneAccessInterface.ipv4Subnet', '10.28.128.0/24'), + self.check('userPlaneAccessInterface.name', 'N2'), + self.check('tags.tag', 'test'), + self.check('tags.tag2', 'test2') + ]) + self.cmd('mobile-network pcdp delete -g {rg} -n {pcdp_name} --pccp-name {pccp_name} -y') + + @ResourceGroupPreparer(name_prefix='cli_test_mobile_network', location='eastus') + def test_mobile_network_data_network(self, resource_group): + self.kwargs.update({ + 'mobile_network': self.create_random_name('mobile_network_', 20), + 'data_network': self.create_random_name('dn', 10) + }) + self.cmd('mobile-network create -n {mobile_network} -g {rg} --identifier {{mcc:001,mnc:01}}', checks=[ + self.check('publicLandMobileNetworkIdentifier.mcc', '001'), + self.check('publicLandMobileNetworkIdentifier.mnc', '01') + ]) + self.cmd('mobile-network data-network create -n {data_network} -g {rg} --mobile-network-name {mobile_network}', checks=[ + self.check('name', '{data_network}') + ]) + self.cmd('mobile-network data-network update -n {data_network} -g {rg} --mobile-network-name {mobile_network} --tags {{tag:test,tag2:test2}}', checks=[ + self.check('name', '{data_network}'), + self.check('tags.tag', 'test'), + self.check('tags.tag2', 'test2') + ]) + self.cmd('mobile-network data-network list --mobile-network-name {mobile_network} -g {rg} ', checks=[ + self.check('[0].name', '{data_network}'), + self.check('[0].tags.tag', 'test'), + self.check('[0].tags.tag2', 'test2') + ]) + self.cmd('mobile-network data-network show -n {data_network} --mobile-network-name {mobile_network} -g {rg}', checks=[ + self.check('name', '{data_network}'), + self.check('tags.tag', 'test'), + self.check('tags.tag2', 'test2') + ]) + self.cmd('mobile-network data-network delete -n {data_network} --mobile-network-name {mobile_network} -g {rg} -y') + + @ResourceGroupPreparer(name_prefix='cli_test_mobile_network', location='eastus') + def test_mobile_network_attached_data_network(self, resource_group): + self.kwargs.update({ + 'mobile_network': self.create_random_name('mobile_network_', 20), + 'site_name': self.create_random_name('site_', 10), + 'pccp_name': self.create_random_name('pccp', 10), + 'pcdp_name': self.create_random_name('pcdp', 10), + 'data_network': self.create_random_name('dn', 10) + }) + self.cmd('mobile-network create -n {mobile_network} -g {rg} --identifier {{mcc:001,mnc:01}}', checks=[ + self.check('publicLandMobileNetworkIdentifier.mcc', '001'), + self.check('publicLandMobileNetworkIdentifier.mnc', '01') + ]) + site = self.cmd('mobile-network site create --mobile-network-name {mobile_network} -n {site_name} -g {rg} ', checks=[ + self.check('name', '{site_name}'), + ]).get_output_in_json() + self.kwargs.update({ + 'site_id': site['id'] + }) + self.cmd('mobile-network pccp create -n {pccp_name} -g {rg} --access-interface {{name:N2,ipv4Address:10.28.128.2,ipv4Subnet:10.28.128.0/24,ipv4Gateway:10.28.128.1}} ' + '--local-diagnostics {{authentication-type:AAD}} --platform {{type:AKS-HCI}} ' + '--sites [{{id:{site_id}}}] --sku G0', checks=[ + self.check('controlPlaneAccessInterface.ipv4Address', '10.28.128.2'), + self.check('controlPlaneAccessInterface.ipv4Gateway', '10.28.128.1'), + self.check('controlPlaneAccessInterface.ipv4Subnet', '10.28.128.0/24'), + self.check('controlPlaneAccessInterface.name', 'N2'), + self.check('localDiagnosticsAccess.authenticationType', 'AAD'), + self.check('platform.type', 'AKS-HCI'), + self.check('name', '{pccp_name}'), + self.check('sku', 'G0'), + self.check('sites[0].id', '{site_id}') + ]) + self.cmd('mobile-network pcdp create -n {pcdp_name} -g {rg} --pccp-name {pccp_name} --access-interface {{name:N2,ipv4Address:10.28.128.2,ipv4Subnet:10.28.128.0/24,ipv4Gateway:10.28.128.1}}', checks=[ + self.check('userPlaneAccessInterface.ipv4Address', '10.28.128.2'), + self.check('userPlaneAccessInterface.ipv4Gateway', '10.28.128.1'), + self.check('userPlaneAccessInterface.ipv4Subnet', '10.28.128.0/24'), + self.check('userPlaneAccessInterface.name', 'N2') + ]) + self.cmd('mobile-network data-network create -n {data_network} -g {rg} --mobile-network-name {mobile_network}', checks=[ + self.check('name', '{data_network}') + ]) + self.cmd('mobile-network attached-data-network create -n {data_network} -g {rg} --pccp-name {pccp_name} --pcdp-name {pcdp_name} --dns-addresses [1.1.1.1]' + ' --data-interface {{name:N2,ipv4Address:10.28.128.2,ipv4Subnet:10.28.128.0/24,ipv4Gateway:10.28.128.1}}', checks=[ + self.check('dnsAddresses[0]', '1.1.1.1'), + self.check('userPlaneDataInterface.ipv4Address', '10.28.128.2'), + self.check('userPlaneDataInterface.ipv4Gateway', '10.28.128.1'), + self.check('userPlaneDataInterface.ipv4Subnet', '10.28.128.0/24'), + self.check('userPlaneDataInterface.name', 'N2') + ]) + self.cmd('mobile-network attached-data-network update -n {data_network} -g {rg} --pccp-name {pccp_name} --pcdp-name {pcdp_name} --tags {{tag:test,tag2:test2}}', checks=[ + self.check('dnsAddresses[0]', '1.1.1.1'), + self.check('userPlaneDataInterface.ipv4Address', '10.28.128.2'), + self.check('userPlaneDataInterface.ipv4Gateway', '10.28.128.1'), + self.check('userPlaneDataInterface.ipv4Subnet', '10.28.128.0/24'), + self.check('userPlaneDataInterface.name', 'N2'), + self.check('tags.tag', 'test'), + self.check('tags.tag2', 'test2') + ]) + self.cmd('mobile-network attached-data-network list -g {rg} --pccp-name {pccp_name} --pcdp-name {pcdp_name}', checks=[ + self.check('[0].dnsAddresses[0]', '1.1.1.1'), + self.check('[0].userPlaneDataInterface.ipv4Address', '10.28.128.2'), + self.check('[0].userPlaneDataInterface.ipv4Gateway', '10.28.128.1'), + self.check('[0].userPlaneDataInterface.ipv4Subnet', '10.28.128.0/24'), + self.check('[0].userPlaneDataInterface.name', 'N2'), + self.check('[0].tags.tag', 'test'), + self.check('[0].tags.tag2', 'test2') + ]) + self.cmd('mobile-network attached-data-network show -n {data_network} --pccp-name {pccp_name} --pcdp-name {pcdp_name} -g {rg}', checks=[ + self.check('dnsAddresses[0]', '1.1.1.1'), + self.check('userPlaneDataInterface.ipv4Address', '10.28.128.2'), + self.check('userPlaneDataInterface.ipv4Gateway', '10.28.128.1'), + self.check('userPlaneDataInterface.ipv4Subnet', '10.28.128.0/24'), + self.check('userPlaneDataInterface.name', 'N2'), + self.check('tags.tag', 'test'), + self.check('tags.tag2', 'test2') + ]) + self.cmd('mobile-network attached-data-network delete -n {data_network} --pccp-name {pccp_name} --pcdp-name {pcdp_name} -g {rg} -y') + + @ResourceGroupPreparer(name_prefix='cli_test_mobile_network', location='eastus') + def test_mobile_network_service(self, resource_group): + self.kwargs.update({ + 'mobile_network': self.create_random_name('mobile_network_', 20), + 'service': self.create_random_name('ser', 10) + }) + self.cmd('mobile-network create -n {mobile_network} -g {rg} --identifier {{mcc:001,mnc:01}}', checks=[ + self.check('publicLandMobileNetworkIdentifier.mcc', '001'), + self.check('publicLandMobileNetworkIdentifier.mnc', '01') + ]) + self.cmd('mobile-network service create -n {service} -g {rg} --mobile-network-name {mobile_network} ' + '--pcc-rules [{{ruleName:default-rule,rulePrecedence:10,serviceDataFlowTemplates:[{{templateName:IP-to-server,direction:Uplink,protocol:[ip],remoteIpList:[10.3.4.0/24]}}]}}] --service-precedence 10', checks=[ + self.check('pccRules[0].ruleName', 'default-rule'), + self.check('pccRules[0].rulePrecedence', '10'), + self.check('pccRules[0].serviceDataFlowTemplates[0].direction', 'Uplink'), + self.check('pccRules[0].serviceDataFlowTemplates[0].protocol[0]', 'ip'), + self.check('pccRules[0].serviceDataFlowTemplates[0].remoteIpList[0]', '10.3.4.0/24'), + self.check('pccRules[0].serviceDataFlowTemplates[0].templateName', 'IP-to-server'), + self.check('servicePrecedence', '10') + ]) + self.cmd('mobile-network service update --mobile-network-name {mobile_network} -g {rg} -n {service} --tags {{tag:test,tag2:test2}}', checks=[ + self.check('pccRules[0].ruleName', 'default-rule'), + self.check('pccRules[0].rulePrecedence', '10'), + self.check('pccRules[0].serviceDataFlowTemplates[0].direction', 'Uplink'), + self.check('pccRules[0].serviceDataFlowTemplates[0].protocol[0]', 'ip'), + self.check('pccRules[0].serviceDataFlowTemplates[0].remoteIpList[0]', '10.3.4.0/24'), + self.check('pccRules[0].serviceDataFlowTemplates[0].templateName', 'IP-to-server'), + self.check('servicePrecedence', '10'), + self.check('tags.tag', 'test'), + self.check('tags.tag2', 'test2') + ]) + self.cmd('mobile-network service list --mobile-network-name {mobile_network} -g {rg} ', checks=[ + self.check('[0].pccRules[0].ruleName', 'default-rule'), + self.check('[0].pccRules[0].rulePrecedence', '10'), + self.check('[0].pccRules[0].serviceDataFlowTemplates[0].direction', 'Uplink'), + self.check('[0].pccRules[0].serviceDataFlowTemplates[0].protocol[0]', 'ip'), + self.check('[0].pccRules[0].serviceDataFlowTemplates[0].remoteIpList[0]', '10.3.4.0/24'), + self.check('[0].pccRules[0].serviceDataFlowTemplates[0].templateName', 'IP-to-server'), + self.check('[0].servicePrecedence', '10'), + self.check('[0].tags.tag', 'test'), + self.check('[0].tags.tag2', 'test2') + ]) + self.cmd('mobile-network service show --mobile-network-name {mobile_network} -n {service} -g {rg}', checks=[ + self.check('pccRules[0].ruleName', 'default-rule'), + self.check('pccRules[0].rulePrecedence', '10'), + self.check('pccRules[0].serviceDataFlowTemplates[0].direction', 'Uplink'), + self.check('pccRules[0].serviceDataFlowTemplates[0].protocol[0]', 'ip'), + self.check('pccRules[0].serviceDataFlowTemplates[0].remoteIpList[0]', '10.3.4.0/24'), + self.check('pccRules[0].serviceDataFlowTemplates[0].templateName', 'IP-to-server'), + self.check('servicePrecedence', '10'), + self.check('tags.tag', 'test'), + self.check('tags.tag2', 'test2') + ]) + self.cmd('mobile-network service delete --mobile-network-name {mobile_network} -n {service} -g {rg} -y') + + @ResourceGroupPreparer(name_prefix='cli_test_mobile_network', location='eastus') + def test_mobile_network_sim(self, resource_group): + self.kwargs.update({ + 'mobile_network': self.create_random_name('mobile_network_', 20), + 'sim_group': self.create_random_name('simgroup', 15), + 'sim': self.create_random_name('sim', 10), + }) + mobile_network = self.cmd('mobile-network create -n {mobile_network} -g {rg} --identifier {{mcc:001,mnc:01}}', checks=[ + self.check('publicLandMobileNetworkIdentifier.mcc', '001'), + self.check('publicLandMobileNetworkIdentifier.mnc', '01') + ]).get_output_in_json() + self.kwargs.update({ + 'mobile_network_id': mobile_network['id'] + }) + self.cmd('mobile-network sim group create -n {sim_group} -g {rg} --mobile-network {{id:{mobile_network_id}}}', checks=[ + self.check('mobileNetwork.id', '{mobile_network_id}'), + self.check('name', '{sim_group}') + ]) + self.cmd('mobile-network sim group update -n {sim_group} -g {rg} --tags {{tag:test,tag2:test2}}', checks=[ + self.check('mobileNetwork.id', '{mobile_network_id}'), + self.check('name', '{sim_group}'), + self.check('tags.tag', 'test'), + self.check('tags.tag2', 'test2') + ]) + self.cmd('mobile-network sim group list -g {rg}', checks=[ + self.check('[0].mobileNetwork.id', '{mobile_network_id}'), + self.check('[0].name', '{sim_group}'), + self.check('[0].tags.tag', 'test'), + self.check('[0].tags.tag2', 'test2') + ]) + self.cmd('mobile-network sim group show -n {sim_group} -g {rg}', checks=[ + self.check('mobileNetwork.id', '{mobile_network_id}'), + self.check('name', '{sim_group}'), + self.check('tags.tag', 'test'), + self.check('tags.tag2', 'test2') + ]) + self.cmd('mobile-network sim create -g {rg} --sim-group-name {sim_group} -n {sim} --international-msi 0000000000 --operator-key-code 00000000000000000000000000000000 --authentication-key 00000000000000000000000000000000', checks=[ + self.check('internationalMobileSubscriberIdentity', '0000000000'), + self.check('name', '{sim}') + ]) + self.cmd('mobile-network sim list -g {rg} --sim-group-name {sim_group} ', checks=[ + self.check('[0].internationalMobileSubscriberIdentity', '0000000000'), + self.check('[0].name', '{sim}') + ]) + self.cmd('mobile-network sim show -g {rg} -n {sim} --sim-group-name {sim_group} ', checks=[ + self.check('internationalMobileSubscriberIdentity', '0000000000'), + self.check('name', '{sim}') + ]) + self.cmd('mobile-network sim delete -g {rg} -n {sim} --sim-group-name {sim_group} -y') + self.cmd('mobile-network sim group delete -n {sim_group} -g {rg} -y') + + @ResourceGroupPreparer(name_prefix='cli_test_mobile_network', location='eastus') + def test_mobile_network_slice(self, resource_group): + self.kwargs.update({ + 'mobile_network': self.create_random_name('mobile_network_', 20), + 'slice': self.create_random_name('slice', 10) + }) + self.cmd('mobile-network create -n {mobile_network} -g {rg} --identifier {{mcc:001,mnc:01}}', checks=[ + self.check('publicLandMobileNetworkIdentifier.mcc', '001'), + self.check('publicLandMobileNetworkIdentifier.mnc', '01') + ]) + self.cmd('mobile-network slice create --mobile-network-name {mobile_network} -n {slice} -g {rg} --snssai {{sst:1,sd:123abc}}', checks=[ + self.check('name', '{slice}'), + self.check('snssai.sd', '123abc'), + self.check('snssai.sst', 1) + ]) + self.cmd('mobile-network slice update --mobile-network-name {mobile_network} -n {slice} -g {rg} --tags {{tag:test,tag2:test2}}', checks=[ + self.check('name', '{slice}'), + self.check('snssai.sd', '123abc'), + self.check('snssai.sst', 1), + self.check('tags.tag', 'test'), + self.check('tags.tag2', 'test2') + ]) + self.cmd('mobile-network slice list --mobile-network-name {mobile_network} -g {rg}', checks=[ + self.check('[0].name', '{slice}'), + self.check('[0].snssai.sd', '123abc'), + self.check('[0].snssai.sst', 1), + self.check('[0].tags.tag', 'test'), + self.check('[0].tags.tag2', 'test2') + ]) + self.cmd('mobile-network slice show --mobile-network-name {mobile_network} -n {slice} -g {rg}', checks=[ + self.check('name', '{slice}'), + self.check('snssai.sd', '123abc'), + self.check('snssai.sst', 1), + self.check('tags.tag', 'test'), + self.check('tags.tag2', 'test2') + ]) + self.cmd('mobile-network slice delete --mobile-network-name {mobile_network} -n {slice} -g {rg} -y') \ No newline at end of file diff --git a/src/mobile-network/setup.cfg b/src/mobile-network/setup.cfg new file mode 100644 index 00000000000..2fdd96e5d39 --- /dev/null +++ b/src/mobile-network/setup.cfg @@ -0,0 +1 @@ +#setup.cfg \ No newline at end of file diff --git a/src/mobile-network/setup.py b/src/mobile-network/setup.py new file mode 100644 index 00000000000..cadba148303 --- /dev/null +++ b/src/mobile-network/setup.py @@ -0,0 +1,49 @@ +# -------------------------------------------------------------------------------------------- +# 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 aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +from codecs import open +from setuptools import setup, find_packages + + +# HISTORY.rst entry. +VERSION = '0.1.0' + +# The full list of classifiers is available at +# https://pypi.python.org/pypi?%3Aaction=list_classifiers +CLASSIFIERS = [ + 'Development Status :: 4 - Beta', + 'Intended Audience :: Developers', + 'Intended Audience :: System Administrators', + 'Programming Language :: Python', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'License :: OSI Approved :: MIT License', +] + +DEPENDENCIES = [] + +with open('README.md', 'r', encoding='utf-8') as f: + README = f.read() +with open('HISTORY.rst', 'r', encoding='utf-8') as f: + HISTORY = f.read() + +setup( + name='mobile-network', + version=VERSION, + description='Microsoft Azure Command-Line Tools MobileNetwork Extension.', + long_description=README + '\n\n' + HISTORY, + license='MIT', + author='Microsoft Corporation', + author_email='azpycli@microsoft.com', + url='https://github.com/Azure/azure-cli-extensions/tree/main/src/mobile-network', + classifiers=CLASSIFIERS, + packages=find_packages(exclude=["tests"]), + package_data={'azext_mobile_network': ['azext_metadata.json']}, + install_requires=DEPENDENCIES +) diff --git a/src/service_name.json b/src/service_name.json index 8235ed4e6bf..f2320827e63 100644 --- a/src/service_name.json +++ b/src/service_name.json @@ -683,5 +683,10 @@ "Command": "az billing-benefits", "AzureServiceName": "Azure Billing Benefits", "URL": "https://learn.microsoft.com/en-us/azure/cost-management-billing/savings-plan/" + }, + { + "Command": "az mobile-network", + "AzureServiceName": "Mobile Network", + "URL": "https://learn.microsoft.com/en-us/azure/private-5g-core/" } ]