[Voice-Service] Microsoft.VoiceServices GA Release (#5845)

This commit is contained in:
songlu 2023-02-08 14:56:29 +08:00 коммит произвёл GitHub
Родитель 02d63b456a
Коммит 492ea8ee32
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
39 изменённых файлов: 5778 добавлений и 0 удалений

2
.github/CODEOWNERS поставляемый
Просмотреть файл

@ -271,3 +271,5 @@
/src/mobile-network/ @jsntcy
/src/automanage/ @calvinhzy
/src/voice-service/ @jsntcy

Просмотреть файл

@ -698,5 +698,10 @@
"Command": "az automanage",
"AzureServiceName": "Azure Automanage",
"URL": "https://learn.microsoft.com/en-us/azure/automanage/"
},
{
"Command": "az voice-service",
"AzureServiceName": "Azure VoiceServices",
"URL": ""
}
]

Просмотреть файл

@ -0,0 +1,8 @@
.. :changelog:
Release History
===============
0.1.0
++++++
* Initial release.

Просмотреть файл

@ -0,0 +1,62 @@
# Azure CLI VoiceService Extension #
This is an extension to Azure CLI to manage VoiceService resources.
## How to use ##
Install this extension using the below CLI command
```
az extension add --name voice-service
```
### Included Features ###
#### voice-service gateway ####
##### Create #####
```
az voice-service gateway create -n gateway-name -g rg --service-locations '[{name:useast,PrimaryRegionProperties:{operatorAddresses:[198.51.100.1],allowedSignalingSourceAddressPrefixes:[10.1.1.0/24],allowedMediaSourceAddressPrefixes:[10.1.2.0/24]}},{name:useast2,PrimaryRegionProperties:{operatorAddresses:[198.51.100.2],allowedSignalingSourceAddressPrefixes:[10.2.1.0/24],allowedMediaSourceAddressPrefixes:[10.2.2.0/24]}}]' --connectivity PublicAddress --codecs '[PCMA]' --e911-type Standard --platforms '[OperatorConnect]'
```
##### Show #####
```
az voice-service gateway show -n gateway-name -g rg
```
##### List #####
```
az voice-service gateway list -g rg
```
##### Update #####
```
az voice-service gateway update -n gateway-name -g rg --tags "{tag:test,tag2:test2}"
```
##### Delete #####
```
az voice-service gateway delete -n gateway-name -g rg -y
```
#### voice-service test-line ####
##### Create #####
```
az voice-service test-line create -n test-line-name -g rg --gateway-name gateway-name --phone-number "+1-555-1234" --purpose Automated
```
##### Show #####
```
az voice-service test-line show -n test-line-name --gateway-name gateway-name -g rg
```
##### List #####
```
az voice-service test-line list -g rg --gateway-name gateway-name
```
##### Update #####
```
az voice-service test-line update -n test-line-name -g rg --gateway-name gateway-name --tags "{tag:test,tag2:test2}"
```
##### Delete #####
```
az voice-service test-line delete -n test-line-name -g rg --gateway-name gateway-name -y
```
#### voice-service check-name-availability ####
```
az voice-service check-name-availability -l centraluseuap --name voicenametest --type microsoft.voiceservices/communicationsgateways/testlines
```

Просмотреть файл

@ -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_voice_service._help import helps # pylint: disable=unused-import
class VoiceServiceCommandsLoader(AzCommandsLoader):
def __init__(self, cli_ctx=None):
from azure.cli.core.commands import CliCommandType
custom_command_type = CliCommandType(
operations_tmpl='azext_voice_service.custom#{}')
super().__init__(cli_ctx=cli_ctx,
custom_command_type=custom_command_type)
def load_command_table(self, args):
from azext_voice_service.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_voice_service._params import load_arguments
load_arguments(self, command)
COMMAND_LOADER_CLS = VoiceServiceCommandsLoader

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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
# --------------------------------------------------------------------------------------------

Просмотреть файл

@ -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
# --------------------------------------------------------------------------------------------

Просмотреть файл

@ -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(
"voice-service",
)
class __CMDGroup(AAZCommandGroup):
"""Manage voice services
"""
pass
__all__ = ["__CMDGroup"]

Просмотреть файл

@ -0,0 +1,12 @@
# --------------------------------------------------------------------------------------------
# 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 ._check_name_availability import *

Просмотреть файл

@ -0,0 +1,189 @@
# --------------------------------------------------------------------------------------------
# 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(
"voice-service check-name-availability",
)
class CheckNameAvailability(AAZCommand):
"""Check whether the resource name is available in the given region.
:example: check name availability
az voice-service check-name-availability -l centraluseuap --name voicenametest --type microsoft.voiceservices/communicationsgateways/testlines
"""
_aaz_info = {
"version": "2023-01-31",
"resources": [
["mgmt-plane", "/subscriptions/{}/providers/microsoft.voiceservices/locations/{}/checknameavailability", "2023-01-31"],
]
}
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.location = AAZResourceLocationArg(
required=True,
id_part="name",
)
# define Arg Group "Body"
_args_schema = cls._args_schema
_args_schema.name = AAZStrArg(
options=["--name"],
arg_group="Body",
help="The name of the resource for which availability needs to be checked.",
)
_args_schema.type = AAZStrArg(
options=["--type"],
arg_group="Body",
help="The resource type.",
)
return cls._args_schema
def _execute_operations(self):
self.pre_operations()
self.NameAvailabilityCheckLocal(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 NameAvailabilityCheckLocal(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.VoiceServices/locations/{location}/checkNameAvailability",
**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(
"location", self.ctx.args.location,
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", "2023-01-31",
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("name", AAZStrType, ".name")
_builder.set_prop("type", AAZStrType, ".type")
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.message = AAZStrType()
_schema_on_200.name_available = AAZBoolType(
serialized_name="nameAvailable",
)
_schema_on_200.reason = AAZStrType()
return cls._schema_on_200
class _CheckNameAvailabilityHelper:
"""Helper class for CheckNameAvailability"""
__all__ = ["CheckNameAvailability"]

Просмотреть файл

@ -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(
"voice-service gateway",
)
class __CMDGroup(AAZCommandGroup):
"""Manage communications gateway
"""
pass
__all__ = ["__CMDGroup"]

Просмотреть файл

@ -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 *

Просмотреть файл

@ -0,0 +1,525 @@
# --------------------------------------------------------------------------------------------
# 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(
"voice-service gateway create",
)
class Create(AAZCommand):
"""Create a communications gateway
:example: Create gateway
az voice-service gateway create -n gw1 -g voicetest --service-locations "[{name:useast,PrimaryRegionProperties:{operatorAddresses:[198.51.100.1],allowedSignalingSourceAddressPrefixes:[10.1.1.0/24],allowedMediaSourceAddressPrefixes:[10.1.2.0/24]}},{name:useast2,PrimaryRegionProperties:{operatorAddresses:[198.51.100.2],allowedSignalingSourceAddressPrefixes:[10.2.1.0/24],allowedMediaSourceAddressPrefixes:[10.2.2.0/24]}}]" --connectivity PublicAddress --codecs "[PCMA]" --e911-type Standard --platforms "[OperatorConnect]"
"""
_aaz_info = {
"version": "2023-01-31",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.voiceservices/communicationsgateways/{}", "2023-01-31"],
]
}
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.gateway_name = AAZStrArg(
options=["-n", "--name", "--gateway-name"],
help="Unique identifier for this deployment",
required=True,
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9-]{3,24}$",
),
)
_args_schema.resource_group = AAZResourceGroupNameArg(
required=True,
)
# define Arg Group "Properties"
_args_schema = cls._args_schema
_args_schema.domain_scope = AAZStrArg(
options=["--domain-scope"],
arg_group="Properties",
help="The scope at which the auto-generated domain name can be re-used",
default="TenantReuse",
enum={"NoReuse": "NoReuse", "ResourceGroupReuse": "ResourceGroupReuse", "SubscriptionReuse": "SubscriptionReuse", "TenantReuse": "TenantReuse"},
)
_args_schema.codecs = AAZListArg(
options=["--codecs"],
arg_group="Properties",
help="Voice codecs to support",
)
_args_schema.connectivity = AAZStrArg(
options=["--connectivity"],
arg_group="Properties",
help="How to connect back to the operator network, e.g. MAPS",
enum={"PublicAddress": "PublicAddress"},
)
_args_schema.e911_type = AAZStrArg(
options=["--e911-type"],
arg_group="Properties",
help="How to handle 911 calls",
enum={"DirectToEsrp": "DirectToEsrp", "Standard": "Standard"},
)
_args_schema.emergency_dial_strings = AAZListArg(
options=["--emergency-dial-strings"],
arg_group="Properties",
help="A list of dial strings used for emergency calling.",
default=["911", "933"],
)
_args_schema.on_prem_mcp_enabled = AAZBoolArg(
options=["--on-prem-mcp-enabled"],
arg_group="Properties",
help="Whether an on-premises Mobile Control Point is in use.",
default=False,
)
_args_schema.platforms = AAZListArg(
options=["--platforms"],
arg_group="Properties",
help="What platforms to support",
)
_args_schema.service_locations = AAZListArg(
options=["--service-locations"],
arg_group="Properties",
help="The regions in which to deploy the resources needed for Teams Calling",
)
_args_schema.teams_voicemail = AAZStrArg(
options=["--teams-voicemail"],
arg_group="Properties",
help="This number is used in Teams Phone Mobile scenarios for access to the voicemail IVR from the native dialer.",
)
codecs = cls._args_schema.codecs
codecs.Element = AAZStrArg(
enum={"G722": "G722", "G722_2": "G722_2", "PCMA": "PCMA", "PCMU": "PCMU", "SILK_16": "SILK_16", "SILK_8": "SILK_8"},
)
emergency_dial_strings = cls._args_schema.emergency_dial_strings
emergency_dial_strings.Element = AAZStrArg()
platforms = cls._args_schema.platforms
platforms.Element = AAZStrArg(
enum={"OperatorConnect": "OperatorConnect", "TeamsPhoneMobile": "TeamsPhoneMobile"},
)
service_locations = cls._args_schema.service_locations
service_locations.Element = AAZObjectArg()
_element = cls._args_schema.service_locations.Element
_element.name = AAZStrArg(
options=["name"],
help="The name of the region in which the resources needed for Teams Calling will be deployed.",
required=True,
)
_element.primary_region_properties = AAZObjectArg(
options=["primary-region-properties"],
help="The configuration used in this region as primary, and other regions as backup.",
required=True,
)
primary_region_properties = cls._args_schema.service_locations.Element.primary_region_properties
primary_region_properties.allowed_media_source_address_prefixes = AAZListArg(
options=["allowed-media-source-address-prefixes"],
help="The allowed source IP address or CIDR ranges for media",
default=[],
)
primary_region_properties.allowed_signaling_source_address_prefixes = AAZListArg(
options=["allowed-signaling-source-address-prefixes"],
help="The allowed source IP address or CIDR ranges for signaling",
default=[],
)
primary_region_properties.esrp_addresses = AAZListArg(
options=["esrp-addresses"],
help="IP address to use to contact the ESRP from this region",
)
primary_region_properties.operator_addresses = AAZListArg(
options=["operator-addresses"],
help="IP address to use to contact the operator network from this region",
required=True,
)
allowed_media_source_address_prefixes = cls._args_schema.service_locations.Element.primary_region_properties.allowed_media_source_address_prefixes
allowed_media_source_address_prefixes.Element = AAZStrArg()
allowed_signaling_source_address_prefixes = cls._args_schema.service_locations.Element.primary_region_properties.allowed_signaling_source_address_prefixes
allowed_signaling_source_address_prefixes.Element = AAZStrArg()
esrp_addresses = cls._args_schema.service_locations.Element.primary_region_properties.esrp_addresses
esrp_addresses.Element = AAZStrArg()
operator_addresses = cls._args_schema.service_locations.Element.primary_region_properties.operator_addresses
operator_addresses.Element = AAZStrArg()
# define Arg Group "Resource"
_args_schema = cls._args_schema
_args_schema.location = AAZResourceLocationArg(
arg_group="Resource",
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="Resource",
help="Resource tags.",
)
tags = cls._args_schema.tags
tags.Element = AAZStrArg()
return cls._args_schema
def _execute_operations(self):
self.pre_operations()
yield self.CommunicationsGatewaysCreateOrUpdate(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 CommunicationsGatewaysCreateOrUpdate(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.VoiceServices/communicationsGateways/{communicationsGatewayName}",
**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(
"communicationsGatewayName", self.ctx.args.gateway_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", "2023-01-31",
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("autoGeneratedDomainNameLabelScope", AAZStrType, ".domain_scope")
properties.set_prop("codecs", AAZListType, ".codecs", typ_kwargs={"flags": {"required": True}})
properties.set_prop("connectivity", AAZStrType, ".connectivity", typ_kwargs={"flags": {"required": True}})
properties.set_prop("e911Type", AAZStrType, ".e911_type", typ_kwargs={"flags": {"required": True}})
properties.set_prop("emergencyDialStrings", AAZListType, ".emergency_dial_strings")
properties.set_prop("onPremMcpEnabled", AAZBoolType, ".on_prem_mcp_enabled")
properties.set_prop("platforms", AAZListType, ".platforms", typ_kwargs={"flags": {"required": True}})
properties.set_prop("serviceLocations", AAZListType, ".service_locations", typ_kwargs={"flags": {"required": True}})
properties.set_prop("teamsVoicemailPilotNumber", AAZStrType, ".teams_voicemail")
codecs = _builder.get(".properties.codecs")
if codecs is not None:
codecs.set_elements(AAZStrType, ".")
emergency_dial_strings = _builder.get(".properties.emergencyDialStrings")
if emergency_dial_strings is not None:
emergency_dial_strings.set_elements(AAZStrType, ".")
platforms = _builder.get(".properties.platforms")
if platforms is not None:
platforms.set_elements(AAZStrType, ".")
service_locations = _builder.get(".properties.serviceLocations")
if service_locations is not None:
service_locations.set_elements(AAZObjectType, ".")
_elements = _builder.get(".properties.serviceLocations[]")
if _elements is not None:
_elements.set_prop("name", AAZStrType, ".name", typ_kwargs={"flags": {"required": True}})
_elements.set_prop("primaryRegionProperties", AAZObjectType, ".primary_region_properties", typ_kwargs={"flags": {"required": True}})
primary_region_properties = _builder.get(".properties.serviceLocations[].primaryRegionProperties")
if primary_region_properties is not None:
primary_region_properties.set_prop("allowedMediaSourceAddressPrefixes", AAZListType, ".allowed_media_source_address_prefixes")
primary_region_properties.set_prop("allowedSignalingSourceAddressPrefixes", AAZListType, ".allowed_signaling_source_address_prefixes")
primary_region_properties.set_prop("esrpAddresses", AAZListType, ".esrp_addresses")
primary_region_properties.set_prop("operatorAddresses", AAZListType, ".operator_addresses", typ_kwargs={"flags": {"required": True}})
allowed_media_source_address_prefixes = _builder.get(".properties.serviceLocations[].primaryRegionProperties.allowedMediaSourceAddressPrefixes")
if allowed_media_source_address_prefixes is not None:
allowed_media_source_address_prefixes.set_elements(AAZStrType, ".")
allowed_signaling_source_address_prefixes = _builder.get(".properties.serviceLocations[].primaryRegionProperties.allowedSignalingSourceAddressPrefixes")
if allowed_signaling_source_address_prefixes is not None:
allowed_signaling_source_address_prefixes.set_elements(AAZStrType, ".")
esrp_addresses = _builder.get(".properties.serviceLocations[].primaryRegionProperties.esrpAddresses")
if esrp_addresses is not None:
esrp_addresses.set_elements(AAZStrType, ".")
operator_addresses = _builder.get(".properties.serviceLocations[].primaryRegionProperties.operatorAddresses")
if operator_addresses is not None:
operator_addresses.set_elements(AAZStrType, ".")
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.auto_generated_domain_name_label = AAZStrType(
serialized_name="autoGeneratedDomainNameLabel",
flags={"read_only": True},
)
properties.auto_generated_domain_name_label_scope = AAZStrType(
serialized_name="autoGeneratedDomainNameLabelScope",
)
properties.codecs = AAZListType(
flags={"required": True},
)
properties.connectivity = AAZStrType(
flags={"required": True},
)
properties.e911_type = AAZStrType(
serialized_name="e911Type",
flags={"required": True},
)
properties.emergency_dial_strings = AAZListType(
serialized_name="emergencyDialStrings",
)
properties.on_prem_mcp_enabled = AAZBoolType(
serialized_name="onPremMcpEnabled",
)
properties.platforms = AAZListType(
flags={"required": True},
)
properties.provisioning_state = AAZStrType(
serialized_name="provisioningState",
)
properties.service_locations = AAZListType(
serialized_name="serviceLocations",
flags={"required": True},
)
properties.status = AAZStrType()
properties.teams_voicemail_pilot_number = AAZStrType(
serialized_name="teamsVoicemailPilotNumber",
)
codecs = cls._schema_on_200_201.properties.codecs
codecs.Element = AAZStrType()
emergency_dial_strings = cls._schema_on_200_201.properties.emergency_dial_strings
emergency_dial_strings.Element = AAZStrType()
platforms = cls._schema_on_200_201.properties.platforms
platforms.Element = AAZStrType()
service_locations = cls._schema_on_200_201.properties.service_locations
service_locations.Element = AAZObjectType()
_element = cls._schema_on_200_201.properties.service_locations.Element
_element.name = AAZStrType(
flags={"required": True},
)
_element.primary_region_properties = AAZObjectType(
serialized_name="primaryRegionProperties",
flags={"required": True},
)
primary_region_properties = cls._schema_on_200_201.properties.service_locations.Element.primary_region_properties
primary_region_properties.allowed_media_source_address_prefixes = AAZListType(
serialized_name="allowedMediaSourceAddressPrefixes",
)
primary_region_properties.allowed_signaling_source_address_prefixes = AAZListType(
serialized_name="allowedSignalingSourceAddressPrefixes",
)
primary_region_properties.esrp_addresses = AAZListType(
serialized_name="esrpAddresses",
)
primary_region_properties.operator_addresses = AAZListType(
serialized_name="operatorAddresses",
flags={"required": True},
)
allowed_media_source_address_prefixes = cls._schema_on_200_201.properties.service_locations.Element.primary_region_properties.allowed_media_source_address_prefixes
allowed_media_source_address_prefixes.Element = AAZStrType()
allowed_signaling_source_address_prefixes = cls._schema_on_200_201.properties.service_locations.Element.primary_region_properties.allowed_signaling_source_address_prefixes
allowed_signaling_source_address_prefixes.Element = AAZStrType()
esrp_addresses = cls._schema_on_200_201.properties.service_locations.Element.primary_region_properties.esrp_addresses
esrp_addresses.Element = AAZStrType()
operator_addresses = cls._schema_on_200_201.properties.service_locations.Element.primary_region_properties.operator_addresses
operator_addresses.Element = 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"]

Просмотреть файл

@ -0,0 +1,166 @@
# --------------------------------------------------------------------------------------------
# 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(
"voice-service gateway delete",
confirmation="Are you sure you want to perform this operation?",
)
class Delete(AAZCommand):
"""Delete a communications gateway
:example: Delete gateway
az voice-service gateway delete -n gateway-name -g rg -y
"""
_aaz_info = {
"version": "2023-01-31",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.voiceservices/communicationsgateways/{}", "2023-01-31"],
]
}
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.gateway_name = AAZStrArg(
options=["-n", "--name", "--gateway-name"],
help="Unique identifier for this deployment",
required=True,
id_part="name",
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9-]{3,24}$",
),
)
_args_schema.resource_group = AAZResourceGroupNameArg(
required=True,
)
return cls._args_schema
def _execute_operations(self):
self.pre_operations()
yield self.CommunicationsGatewaysDelete(ctx=self.ctx)()
self.post_operations()
@register_callback
def pre_operations(self):
pass
@register_callback
def post_operations(self):
pass
class CommunicationsGatewaysDelete(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": "azure-async-operation"},
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": "azure-async-operation"},
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": "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.VoiceServices/communicationsGateways/{communicationsGatewayName}",
**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(
"communicationsGatewayName", self.ctx.args.gateway_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", "2023-01-31",
required=True,
),
}
return parameters
def on_200(self, session):
pass
def on_204(self, session):
pass
class _DeleteHelper:
"""Helper class for Delete"""
__all__ = ["Delete"]

Просмотреть файл

@ -0,0 +1,516 @@
# --------------------------------------------------------------------------------------------
# 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(
"voice-service gateway list",
)
class List(AAZCommand):
"""List communications gateway resources by resource group
:example: List gateway by resource group
az voice-service gateway list -g rg
"""
_aaz_info = {
"version": "2023-01-31",
"resources": [
["mgmt-plane", "/subscriptions/{}/providers/microsoft.voiceservices/communicationsgateways", "2023-01-31"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.voiceservices/communicationsgateways", "2023-01-31"],
]
}
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.CommunicationsGatewaysListByResourceGroup(ctx=self.ctx)()
if condition_1:
self.CommunicationsGatewaysListBySubscription(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 CommunicationsGatewaysListByResourceGroup(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.VoiceServices/communicationsGateways",
**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", "2023-01-31",
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",
)
_schema_on_200.value = AAZListType(
flags={"required": True},
)
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.auto_generated_domain_name_label = AAZStrType(
serialized_name="autoGeneratedDomainNameLabel",
flags={"read_only": True},
)
properties.auto_generated_domain_name_label_scope = AAZStrType(
serialized_name="autoGeneratedDomainNameLabelScope",
)
properties.codecs = AAZListType(
flags={"required": True},
)
properties.connectivity = AAZStrType(
flags={"required": True},
)
properties.e911_type = AAZStrType(
serialized_name="e911Type",
flags={"required": True},
)
properties.emergency_dial_strings = AAZListType(
serialized_name="emergencyDialStrings",
)
properties.on_prem_mcp_enabled = AAZBoolType(
serialized_name="onPremMcpEnabled",
)
properties.platforms = AAZListType(
flags={"required": True},
)
properties.provisioning_state = AAZStrType(
serialized_name="provisioningState",
)
properties.service_locations = AAZListType(
serialized_name="serviceLocations",
flags={"required": True},
)
properties.status = AAZStrType()
properties.teams_voicemail_pilot_number = AAZStrType(
serialized_name="teamsVoicemailPilotNumber",
)
codecs = cls._schema_on_200.value.Element.properties.codecs
codecs.Element = AAZStrType()
emergency_dial_strings = cls._schema_on_200.value.Element.properties.emergency_dial_strings
emergency_dial_strings.Element = AAZStrType()
platforms = cls._schema_on_200.value.Element.properties.platforms
platforms.Element = AAZStrType()
service_locations = cls._schema_on_200.value.Element.properties.service_locations
service_locations.Element = AAZObjectType()
_element = cls._schema_on_200.value.Element.properties.service_locations.Element
_element.name = AAZStrType(
flags={"required": True},
)
_element.primary_region_properties = AAZObjectType(
serialized_name="primaryRegionProperties",
flags={"required": True},
)
primary_region_properties = cls._schema_on_200.value.Element.properties.service_locations.Element.primary_region_properties
primary_region_properties.allowed_media_source_address_prefixes = AAZListType(
serialized_name="allowedMediaSourceAddressPrefixes",
)
primary_region_properties.allowed_signaling_source_address_prefixes = AAZListType(
serialized_name="allowedSignalingSourceAddressPrefixes",
)
primary_region_properties.esrp_addresses = AAZListType(
serialized_name="esrpAddresses",
)
primary_region_properties.operator_addresses = AAZListType(
serialized_name="operatorAddresses",
flags={"required": True},
)
allowed_media_source_address_prefixes = cls._schema_on_200.value.Element.properties.service_locations.Element.primary_region_properties.allowed_media_source_address_prefixes
allowed_media_source_address_prefixes.Element = AAZStrType()
allowed_signaling_source_address_prefixes = cls._schema_on_200.value.Element.properties.service_locations.Element.primary_region_properties.allowed_signaling_source_address_prefixes
allowed_signaling_source_address_prefixes.Element = AAZStrType()
esrp_addresses = cls._schema_on_200.value.Element.properties.service_locations.Element.primary_region_properties.esrp_addresses
esrp_addresses.Element = AAZStrType()
operator_addresses = cls._schema_on_200.value.Element.properties.service_locations.Element.primary_region_properties.operator_addresses
operator_addresses.Element = 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 CommunicationsGatewaysListBySubscription(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.VoiceServices/communicationsGateways",
**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", "2023-01-31",
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",
)
_schema_on_200.value = AAZListType(
flags={"required": True},
)
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.auto_generated_domain_name_label = AAZStrType(
serialized_name="autoGeneratedDomainNameLabel",
flags={"read_only": True},
)
properties.auto_generated_domain_name_label_scope = AAZStrType(
serialized_name="autoGeneratedDomainNameLabelScope",
)
properties.codecs = AAZListType(
flags={"required": True},
)
properties.connectivity = AAZStrType(
flags={"required": True},
)
properties.e911_type = AAZStrType(
serialized_name="e911Type",
flags={"required": True},
)
properties.emergency_dial_strings = AAZListType(
serialized_name="emergencyDialStrings",
)
properties.on_prem_mcp_enabled = AAZBoolType(
serialized_name="onPremMcpEnabled",
)
properties.platforms = AAZListType(
flags={"required": True},
)
properties.provisioning_state = AAZStrType(
serialized_name="provisioningState",
)
properties.service_locations = AAZListType(
serialized_name="serviceLocations",
flags={"required": True},
)
properties.status = AAZStrType()
properties.teams_voicemail_pilot_number = AAZStrType(
serialized_name="teamsVoicemailPilotNumber",
)
codecs = cls._schema_on_200.value.Element.properties.codecs
codecs.Element = AAZStrType()
emergency_dial_strings = cls._schema_on_200.value.Element.properties.emergency_dial_strings
emergency_dial_strings.Element = AAZStrType()
platforms = cls._schema_on_200.value.Element.properties.platforms
platforms.Element = AAZStrType()
service_locations = cls._schema_on_200.value.Element.properties.service_locations
service_locations.Element = AAZObjectType()
_element = cls._schema_on_200.value.Element.properties.service_locations.Element
_element.name = AAZStrType(
flags={"required": True},
)
_element.primary_region_properties = AAZObjectType(
serialized_name="primaryRegionProperties",
flags={"required": True},
)
primary_region_properties = cls._schema_on_200.value.Element.properties.service_locations.Element.primary_region_properties
primary_region_properties.allowed_media_source_address_prefixes = AAZListType(
serialized_name="allowedMediaSourceAddressPrefixes",
)
primary_region_properties.allowed_signaling_source_address_prefixes = AAZListType(
serialized_name="allowedSignalingSourceAddressPrefixes",
)
primary_region_properties.esrp_addresses = AAZListType(
serialized_name="esrpAddresses",
)
primary_region_properties.operator_addresses = AAZListType(
serialized_name="operatorAddresses",
flags={"required": True},
)
allowed_media_source_address_prefixes = cls._schema_on_200.value.Element.properties.service_locations.Element.primary_region_properties.allowed_media_source_address_prefixes
allowed_media_source_address_prefixes.Element = AAZStrType()
allowed_signaling_source_address_prefixes = cls._schema_on_200.value.Element.properties.service_locations.Element.primary_region_properties.allowed_signaling_source_address_prefixes
allowed_signaling_source_address_prefixes.Element = AAZStrType()
esrp_addresses = cls._schema_on_200.value.Element.properties.service_locations.Element.primary_region_properties.esrp_addresses
esrp_addresses.Element = AAZStrType()
operator_addresses = cls._schema_on_200.value.Element.properties.service_locations.Element.primary_region_properties.operator_addresses
operator_addresses.Element = 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"]

Просмотреть файл

@ -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(
"voice-service gateway show",
)
class Show(AAZCommand):
"""Show a communications gateway
:example: Show a gateway
az voice-service gateway show -n gateway-name -g rg
"""
_aaz_info = {
"version": "2023-01-31",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.voiceservices/communicationsgateways/{}", "2023-01-31"],
]
}
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.gateway_name = AAZStrArg(
options=["-n", "--name", "--gateway-name"],
help="Unique identifier for this deployment",
required=True,
id_part="name",
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9-]{3,24}$",
),
)
_args_schema.resource_group = AAZResourceGroupNameArg(
required=True,
)
return cls._args_schema
def _execute_operations(self):
self.pre_operations()
self.CommunicationsGatewaysGet(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 CommunicationsGatewaysGet(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.VoiceServices/communicationsGateways/{communicationsGatewayName}",
**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(
"communicationsGatewayName", self.ctx.args.gateway_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", "2023-01-31",
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.auto_generated_domain_name_label = AAZStrType(
serialized_name="autoGeneratedDomainNameLabel",
flags={"read_only": True},
)
properties.auto_generated_domain_name_label_scope = AAZStrType(
serialized_name="autoGeneratedDomainNameLabelScope",
)
properties.codecs = AAZListType(
flags={"required": True},
)
properties.connectivity = AAZStrType(
flags={"required": True},
)
properties.e911_type = AAZStrType(
serialized_name="e911Type",
flags={"required": True},
)
properties.emergency_dial_strings = AAZListType(
serialized_name="emergencyDialStrings",
)
properties.on_prem_mcp_enabled = AAZBoolType(
serialized_name="onPremMcpEnabled",
)
properties.platforms = AAZListType(
flags={"required": True},
)
properties.provisioning_state = AAZStrType(
serialized_name="provisioningState",
)
properties.service_locations = AAZListType(
serialized_name="serviceLocations",
flags={"required": True},
)
properties.status = AAZStrType()
properties.teams_voicemail_pilot_number = AAZStrType(
serialized_name="teamsVoicemailPilotNumber",
)
codecs = cls._schema_on_200.properties.codecs
codecs.Element = AAZStrType()
emergency_dial_strings = cls._schema_on_200.properties.emergency_dial_strings
emergency_dial_strings.Element = AAZStrType()
platforms = cls._schema_on_200.properties.platforms
platforms.Element = AAZStrType()
service_locations = cls._schema_on_200.properties.service_locations
service_locations.Element = AAZObjectType()
_element = cls._schema_on_200.properties.service_locations.Element
_element.name = AAZStrType(
flags={"required": True},
)
_element.primary_region_properties = AAZObjectType(
serialized_name="primaryRegionProperties",
flags={"required": True},
)
primary_region_properties = cls._schema_on_200.properties.service_locations.Element.primary_region_properties
primary_region_properties.allowed_media_source_address_prefixes = AAZListType(
serialized_name="allowedMediaSourceAddressPrefixes",
)
primary_region_properties.allowed_signaling_source_address_prefixes = AAZListType(
serialized_name="allowedSignalingSourceAddressPrefixes",
)
primary_region_properties.esrp_addresses = AAZListType(
serialized_name="esrpAddresses",
)
primary_region_properties.operator_addresses = AAZListType(
serialized_name="operatorAddresses",
flags={"required": True},
)
allowed_media_source_address_prefixes = cls._schema_on_200.properties.service_locations.Element.primary_region_properties.allowed_media_source_address_prefixes
allowed_media_source_address_prefixes.Element = AAZStrType()
allowed_signaling_source_address_prefixes = cls._schema_on_200.properties.service_locations.Element.primary_region_properties.allowed_signaling_source_address_prefixes
allowed_signaling_source_address_prefixes.Element = AAZStrType()
esrp_addresses = cls._schema_on_200.properties.service_locations.Element.primary_region_properties.esrp_addresses
esrp_addresses.Element = AAZStrType()
operator_addresses = cls._schema_on_200.properties.service_locations.Element.primary_region_properties.operator_addresses
operator_addresses.Element = 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"]

Просмотреть файл

@ -0,0 +1,491 @@
# --------------------------------------------------------------------------------------------
# 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(
"voice-service gateway update",
)
class Update(AAZCommand):
"""Update a communications gateway
:example: Update a gateway
az voice-service gateway update -n gateway-name -g rg --tags "{tag:test,tag2:test2}"
"""
_aaz_info = {
"version": "2023-01-31",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.voiceservices/communicationsgateways/{}", "2023-01-31"],
]
}
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.gateway_name = AAZStrArg(
options=["-n", "--name", "--gateway-name"],
help="Unique identifier for this deployment",
required=True,
id_part="name",
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9-]{3,24}$",
),
)
_args_schema.resource_group = AAZResourceGroupNameArg(
required=True,
)
# define Arg Group "Resource"
_args_schema = cls._args_schema
_args_schema.tags = AAZDictArg(
options=["--tags"],
arg_group="Resource",
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.CommunicationsGatewaysGet(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.CommunicationsGatewaysCreateOrUpdate(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 CommunicationsGatewaysGet(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.VoiceServices/communicationsGateways/{communicationsGatewayName}",
**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(
"communicationsGatewayName", self.ctx.args.gateway_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", "2023-01-31",
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_communications_gateway_read(cls._schema_on_200)
return cls._schema_on_200
class CommunicationsGatewaysCreateOrUpdate(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.VoiceServices/communicationsGateways/{communicationsGatewayName}",
**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(
"communicationsGatewayName", self.ctx.args.gateway_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", "2023-01-31",
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_communications_gateway_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_communications_gateway_read = None
@classmethod
def _build_schema_communications_gateway_read(cls, _schema):
if cls._schema_communications_gateway_read is not None:
_schema.id = cls._schema_communications_gateway_read.id
_schema.location = cls._schema_communications_gateway_read.location
_schema.name = cls._schema_communications_gateway_read.name
_schema.properties = cls._schema_communications_gateway_read.properties
_schema.system_data = cls._schema_communications_gateway_read.system_data
_schema.tags = cls._schema_communications_gateway_read.tags
_schema.type = cls._schema_communications_gateway_read.type
return
cls._schema_communications_gateway_read = _schema_communications_gateway_read = AAZObjectType()
communications_gateway_read = _schema_communications_gateway_read
communications_gateway_read.id = AAZStrType(
flags={"read_only": True},
)
communications_gateway_read.location = AAZStrType(
flags={"required": True},
)
communications_gateway_read.name = AAZStrType(
flags={"read_only": True},
)
communications_gateway_read.properties = AAZObjectType(
flags={"client_flatten": True},
)
communications_gateway_read.system_data = AAZObjectType(
serialized_name="systemData",
flags={"read_only": True},
)
communications_gateway_read.tags = AAZDictType()
communications_gateway_read.type = AAZStrType(
flags={"read_only": True},
)
properties = _schema_communications_gateway_read.properties
properties.auto_generated_domain_name_label = AAZStrType(
serialized_name="autoGeneratedDomainNameLabel",
flags={"read_only": True},
)
properties.auto_generated_domain_name_label_scope = AAZStrType(
serialized_name="autoGeneratedDomainNameLabelScope",
)
properties.codecs = AAZListType(
flags={"required": True},
)
properties.connectivity = AAZStrType(
flags={"required": True},
)
properties.e911_type = AAZStrType(
serialized_name="e911Type",
flags={"required": True},
)
properties.emergency_dial_strings = AAZListType(
serialized_name="emergencyDialStrings",
)
properties.on_prem_mcp_enabled = AAZBoolType(
serialized_name="onPremMcpEnabled",
)
properties.platforms = AAZListType(
flags={"required": True},
)
properties.provisioning_state = AAZStrType(
serialized_name="provisioningState",
)
properties.service_locations = AAZListType(
serialized_name="serviceLocations",
flags={"required": True},
)
properties.status = AAZStrType()
properties.teams_voicemail_pilot_number = AAZStrType(
serialized_name="teamsVoicemailPilotNumber",
)
codecs = _schema_communications_gateway_read.properties.codecs
codecs.Element = AAZStrType()
emergency_dial_strings = _schema_communications_gateway_read.properties.emergency_dial_strings
emergency_dial_strings.Element = AAZStrType()
platforms = _schema_communications_gateway_read.properties.platforms
platforms.Element = AAZStrType()
service_locations = _schema_communications_gateway_read.properties.service_locations
service_locations.Element = AAZObjectType()
_element = _schema_communications_gateway_read.properties.service_locations.Element
_element.name = AAZStrType(
flags={"required": True},
)
_element.primary_region_properties = AAZObjectType(
serialized_name="primaryRegionProperties",
flags={"required": True},
)
primary_region_properties = _schema_communications_gateway_read.properties.service_locations.Element.primary_region_properties
primary_region_properties.allowed_media_source_address_prefixes = AAZListType(
serialized_name="allowedMediaSourceAddressPrefixes",
)
primary_region_properties.allowed_signaling_source_address_prefixes = AAZListType(
serialized_name="allowedSignalingSourceAddressPrefixes",
)
primary_region_properties.esrp_addresses = AAZListType(
serialized_name="esrpAddresses",
)
primary_region_properties.operator_addresses = AAZListType(
serialized_name="operatorAddresses",
flags={"required": True},
)
allowed_media_source_address_prefixes = _schema_communications_gateway_read.properties.service_locations.Element.primary_region_properties.allowed_media_source_address_prefixes
allowed_media_source_address_prefixes.Element = AAZStrType()
allowed_signaling_source_address_prefixes = _schema_communications_gateway_read.properties.service_locations.Element.primary_region_properties.allowed_signaling_source_address_prefixes
allowed_signaling_source_address_prefixes.Element = AAZStrType()
esrp_addresses = _schema_communications_gateway_read.properties.service_locations.Element.primary_region_properties.esrp_addresses
esrp_addresses.Element = AAZStrType()
operator_addresses = _schema_communications_gateway_read.properties.service_locations.Element.primary_region_properties.operator_addresses
operator_addresses.Element = AAZStrType()
system_data = _schema_communications_gateway_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_communications_gateway_read.tags
tags.Element = AAZStrType()
_schema.id = cls._schema_communications_gateway_read.id
_schema.location = cls._schema_communications_gateway_read.location
_schema.name = cls._schema_communications_gateway_read.name
_schema.properties = cls._schema_communications_gateway_read.properties
_schema.system_data = cls._schema_communications_gateway_read.system_data
_schema.tags = cls._schema_communications_gateway_read.tags
_schema.type = cls._schema_communications_gateway_read.type
__all__ = ["Update"]

Просмотреть файл

@ -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(
"voice-service gateway 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.voiceservices/communicationsgateways/{}", "2023-01-31"],
]
}
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.gateway_name = AAZStrArg(
options=["-n", "--name", "--gateway-name"],
help="Unique identifier for this deployment",
required=True,
id_part="name",
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9-]{3,24}$",
),
)
_args_schema.resource_group = AAZResourceGroupNameArg(
required=True,
)
return cls._args_schema
def _execute_operations(self):
self.pre_operations()
self.CommunicationsGatewaysGet(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 CommunicationsGatewaysGet(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.VoiceServices/communicationsGateways/{communicationsGatewayName}",
**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(
"communicationsGatewayName", self.ctx.args.gateway_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", "2023-01-31",
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.auto_generated_domain_name_label = AAZStrType(
serialized_name="autoGeneratedDomainNameLabel",
flags={"read_only": True},
)
properties.auto_generated_domain_name_label_scope = AAZStrType(
serialized_name="autoGeneratedDomainNameLabelScope",
)
properties.codecs = AAZListType(
flags={"required": True},
)
properties.connectivity = AAZStrType(
flags={"required": True},
)
properties.e911_type = AAZStrType(
serialized_name="e911Type",
flags={"required": True},
)
properties.emergency_dial_strings = AAZListType(
serialized_name="emergencyDialStrings",
)
properties.on_prem_mcp_enabled = AAZBoolType(
serialized_name="onPremMcpEnabled",
)
properties.platforms = AAZListType(
flags={"required": True},
)
properties.provisioning_state = AAZStrType(
serialized_name="provisioningState",
)
properties.service_locations = AAZListType(
serialized_name="serviceLocations",
flags={"required": True},
)
properties.status = AAZStrType()
properties.teams_voicemail_pilot_number = AAZStrType(
serialized_name="teamsVoicemailPilotNumber",
)
codecs = cls._schema_on_200.properties.codecs
codecs.Element = AAZStrType()
emergency_dial_strings = cls._schema_on_200.properties.emergency_dial_strings
emergency_dial_strings.Element = AAZStrType()
platforms = cls._schema_on_200.properties.platforms
platforms.Element = AAZStrType()
service_locations = cls._schema_on_200.properties.service_locations
service_locations.Element = AAZObjectType()
_element = cls._schema_on_200.properties.service_locations.Element
_element.name = AAZStrType(
flags={"required": True},
)
_element.primary_region_properties = AAZObjectType(
serialized_name="primaryRegionProperties",
flags={"required": True},
)
primary_region_properties = cls._schema_on_200.properties.service_locations.Element.primary_region_properties
primary_region_properties.allowed_media_source_address_prefixes = AAZListType(
serialized_name="allowedMediaSourceAddressPrefixes",
)
primary_region_properties.allowed_signaling_source_address_prefixes = AAZListType(
serialized_name="allowedSignalingSourceAddressPrefixes",
)
primary_region_properties.esrp_addresses = AAZListType(
serialized_name="esrpAddresses",
)
primary_region_properties.operator_addresses = AAZListType(
serialized_name="operatorAddresses",
flags={"required": True},
)
allowed_media_source_address_prefixes = cls._schema_on_200.properties.service_locations.Element.primary_region_properties.allowed_media_source_address_prefixes
allowed_media_source_address_prefixes.Element = AAZStrType()
allowed_signaling_source_address_prefixes = cls._schema_on_200.properties.service_locations.Element.primary_region_properties.allowed_signaling_source_address_prefixes
allowed_signaling_source_address_prefixes.Element = AAZStrType()
esrp_addresses = cls._schema_on_200.properties.service_locations.Element.primary_region_properties.esrp_addresses
esrp_addresses.Element = AAZStrType()
operator_addresses = cls._schema_on_200.properties.service_locations.Element.primary_region_properties.operator_addresses
operator_addresses.Element = 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"]

Просмотреть файл

@ -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(
"voice-service test-line",
)
class __CMDGroup(AAZCommandGroup):
"""Manage gateway test line
"""
pass
__all__ = ["__CMDGroup"]

Просмотреть файл

@ -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 *

Просмотреть файл

@ -0,0 +1,310 @@
# --------------------------------------------------------------------------------------------
# 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(
"voice-service test-line create",
)
class Create(AAZCommand):
"""Create a test line
:example: Create test line
az voice-service test-line create -n test-line-name -g rg --gateway-name gateway-name --phone-number "+1-555-1234" --purpose Automated
"""
_aaz_info = {
"version": "2023-01-31",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.voiceservices/communicationsgateways/{}/testlines/{}", "2023-01-31"],
]
}
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.gateway_name = AAZStrArg(
options=["--gateway-name"],
help="Unique identifier for this deployment",
required=True,
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9-]{3,24}$",
),
)
_args_schema.resource_group = AAZResourceGroupNameArg(
required=True,
)
_args_schema.test_line_name = AAZStrArg(
options=["-n", "--name", "--test-line-name"],
help="Unique identifier for this test line",
required=True,
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9-]{3,24}$",
),
)
# define Arg Group "Properties"
_args_schema = cls._args_schema
_args_schema.phone_number = AAZStrArg(
options=["--phone-number"],
arg_group="Properties",
help="The phone number",
)
_args_schema.purpose = AAZStrArg(
options=["--purpose"],
arg_group="Properties",
help="Purpose of this test line, e.g. automated or manual testing",
enum={"Automated": "Automated", "Manual": "Manual"},
)
# define Arg Group "Resource"
_args_schema = cls._args_schema
_args_schema.location = AAZResourceLocationArg(
arg_group="Resource",
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="Resource",
help="Resource tags.",
)
tags = cls._args_schema.tags
tags.Element = AAZStrArg()
return cls._args_schema
def _execute_operations(self):
self.pre_operations()
yield self.TestLinesCreateOrUpdate(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 TestLinesCreateOrUpdate(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.VoiceServices/communicationsGateways/{communicationsGatewayName}/testLines/{testLineName}",
**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(
"communicationsGatewayName", self.ctx.args.gateway_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,
),
**self.serialize_url_param(
"testLineName", self.ctx.args.test_line_name,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2023-01-31",
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("phoneNumber", AAZStrType, ".phone_number", typ_kwargs={"flags": {"required": True}})
properties.set_prop("purpose", AAZStrType, ".purpose", 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={"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.phone_number = AAZStrType(
serialized_name="phoneNumber",
flags={"required": True},
)
properties.provisioning_state = AAZStrType(
serialized_name="provisioningState",
)
properties.purpose = 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"]

Просмотреть файл

@ -0,0 +1,179 @@
# --------------------------------------------------------------------------------------------
# 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(
"voice-service test-line delete",
confirmation="Are you sure you want to perform this operation?",
)
class Delete(AAZCommand):
"""Delete a test line
:example: Delete test line
az voice-service test-line delete -n test-line-name -g rg --gateway-name gateway-name -y
"""
_aaz_info = {
"version": "2023-01-31",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.voiceservices/communicationsgateways/{}/testlines/{}", "2023-01-31"],
]
}
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.gateway_name = AAZStrArg(
options=["--gateway-name"],
help="Unique identifier for this deployment",
required=True,
id_part="name",
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9-]{3,24}$",
),
)
_args_schema.resource_group = AAZResourceGroupNameArg(
required=True,
)
_args_schema.test_line_name = AAZStrArg(
options=["-n", "--name", "--test-line-name"],
help="Unique identifier for this test line",
required=True,
id_part="child_name_1",
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9-]{3,24}$",
),
)
return cls._args_schema
def _execute_operations(self):
self.pre_operations()
yield self.TestLinesDelete(ctx=self.ctx)()
self.post_operations()
@register_callback
def pre_operations(self):
pass
@register_callback
def post_operations(self):
pass
class TestLinesDelete(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": "azure-async-operation"},
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": "azure-async-operation"},
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": "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.VoiceServices/communicationsGateways/{communicationsGatewayName}/testLines/{testLineName}",
**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(
"communicationsGatewayName", self.ctx.args.gateway_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,
),
**self.serialize_url_param(
"testLineName", self.ctx.args.test_line_name,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2023-01-31",
required=True,
),
}
return parameters
def on_200(self, session):
pass
def on_204(self, session):
pass
class _DeleteHelper:
"""Helper class for Delete"""
__all__ = ["Delete"]

Просмотреть файл

@ -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(
"voice-service test-line list",
)
class List(AAZCommand):
"""List test line resources by communications gateway
:example: List test line by resource group and gateway
az voice-service test-line list --gateway-name gateway-name -g rg
"""
_aaz_info = {
"version": "2023-01-31",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.voiceservices/communicationsgateways/{}/testlines", "2023-01-31"],
]
}
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.gateway_name = AAZStrArg(
options=["--gateway-name"],
help="Unique identifier for this deployment",
required=True,
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9-]{3,24}$",
),
)
_args_schema.resource_group = AAZResourceGroupNameArg(
required=True,
)
return cls._args_schema
def _execute_operations(self):
self.pre_operations()
self.TestLinesListByCommunicationsGateway(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 TestLinesListByCommunicationsGateway(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.VoiceServices/communicationsGateways/{communicationsGatewayName}/testLines",
**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(
"communicationsGatewayName", self.ctx.args.gateway_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", "2023-01-31",
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",
)
_schema_on_200.value = AAZListType(
flags={"required": True},
)
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.phone_number = AAZStrType(
serialized_name="phoneNumber",
flags={"required": True},
)
properties.provisioning_state = AAZStrType(
serialized_name="provisioningState",
)
properties.purpose = 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"]

Просмотреть файл

@ -0,0 +1,235 @@
# --------------------------------------------------------------------------------------------
# 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(
"voice-service test-line show",
)
class Show(AAZCommand):
"""Show a test line
:example: Show a test line
az voice-service test-line show -n test-line-name -g rg --gateway-name gateway-name
"""
_aaz_info = {
"version": "2023-01-31",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.voiceservices/communicationsgateways/{}/testlines/{}", "2023-01-31"],
]
}
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.gateway_name = AAZStrArg(
options=["--gateway-name"],
help="Unique identifier for this deployment",
required=True,
id_part="name",
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9-]{3,24}$",
),
)
_args_schema.resource_group = AAZResourceGroupNameArg(
required=True,
)
_args_schema.test_line_name = AAZStrArg(
options=["-n", "--name", "--test-line-name"],
help="Unique identifier for this test line",
required=True,
id_part="child_name_1",
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9-]{3,24}$",
),
)
return cls._args_schema
def _execute_operations(self):
self.pre_operations()
self.TestLinesGet(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 TestLinesGet(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.VoiceServices/communicationsGateways/{communicationsGatewayName}/testLines/{testLineName}",
**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(
"communicationsGatewayName", self.ctx.args.gateway_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,
),
**self.serialize_url_param(
"testLineName", self.ctx.args.test_line_name,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2023-01-31",
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.phone_number = AAZStrType(
serialized_name="phoneNumber",
flags={"required": True},
)
properties.provisioning_state = AAZStrType(
serialized_name="provisioningState",
)
properties.purpose = 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"]

Просмотреть файл

@ -0,0 +1,433 @@
# --------------------------------------------------------------------------------------------
# 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(
"voice-service test-line update",
)
class Update(AAZCommand):
"""Update a test line
:example: Update test line
az voice-service test-line update -n test-line-name --gateway-name gateway-name -g rg --tags "{tag:test,tag2:test2}"
"""
_aaz_info = {
"version": "2023-01-31",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.voiceservices/communicationsgateways/{}/testlines/{}", "2023-01-31"],
]
}
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.gateway_name = AAZStrArg(
options=["--gateway-name"],
help="Unique identifier for this deployment",
required=True,
id_part="name",
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9-]{3,24}$",
),
)
_args_schema.resource_group = AAZResourceGroupNameArg(
required=True,
)
_args_schema.test_line_name = AAZStrArg(
options=["-n", "--name", "--test-line-name"],
help="Unique identifier for this test line",
required=True,
id_part="child_name_1",
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9-]{3,24}$",
),
)
# define Arg Group "Resource"
_args_schema = cls._args_schema
_args_schema.tags = AAZDictArg(
options=["--tags"],
arg_group="Resource",
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.TestLinesGet(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.TestLinesCreateOrUpdate(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 TestLinesGet(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.VoiceServices/communicationsGateways/{communicationsGatewayName}/testLines/{testLineName}",
**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(
"communicationsGatewayName", self.ctx.args.gateway_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,
),
**self.serialize_url_param(
"testLineName", self.ctx.args.test_line_name,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2023-01-31",
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_test_line_read(cls._schema_on_200)
return cls._schema_on_200
class TestLinesCreateOrUpdate(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.VoiceServices/communicationsGateways/{communicationsGatewayName}/testLines/{testLineName}",
**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(
"communicationsGatewayName", self.ctx.args.gateway_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,
),
**self.serialize_url_param(
"testLineName", self.ctx.args.test_line_name,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2023-01-31",
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_test_line_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_test_line_read = None
@classmethod
def _build_schema_test_line_read(cls, _schema):
if cls._schema_test_line_read is not None:
_schema.id = cls._schema_test_line_read.id
_schema.location = cls._schema_test_line_read.location
_schema.name = cls._schema_test_line_read.name
_schema.properties = cls._schema_test_line_read.properties
_schema.system_data = cls._schema_test_line_read.system_data
_schema.tags = cls._schema_test_line_read.tags
_schema.type = cls._schema_test_line_read.type
return
cls._schema_test_line_read = _schema_test_line_read = AAZObjectType()
test_line_read = _schema_test_line_read
test_line_read.id = AAZStrType(
flags={"read_only": True},
)
test_line_read.location = AAZStrType(
flags={"required": True},
)
test_line_read.name = AAZStrType(
flags={"read_only": True},
)
test_line_read.properties = AAZObjectType(
flags={"client_flatten": True},
)
test_line_read.system_data = AAZObjectType(
serialized_name="systemData",
flags={"read_only": True},
)
test_line_read.tags = AAZDictType()
test_line_read.type = AAZStrType(
flags={"read_only": True},
)
properties = _schema_test_line_read.properties
properties.phone_number = AAZStrType(
serialized_name="phoneNumber",
flags={"required": True},
)
properties.provisioning_state = AAZStrType(
serialized_name="provisioningState",
)
properties.purpose = AAZStrType(
flags={"required": True},
)
system_data = _schema_test_line_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_test_line_read.tags
tags.Element = AAZStrType()
_schema.id = cls._schema_test_line_read.id
_schema.location = cls._schema_test_line_read.location
_schema.name = cls._schema_test_line_read.name
_schema.properties = cls._schema_test_line_read.properties
_schema.system_data = cls._schema_test_line_read.system_data
_schema.tags = cls._schema_test_line_read.tags
_schema.type = cls._schema_test_line_read.type
__all__ = ["Update"]

Просмотреть файл

@ -0,0 +1,231 @@
# --------------------------------------------------------------------------------------------
# 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(
"voice-service test-line 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.voiceservices/communicationsgateways/{}/testlines/{}", "2023-01-31"],
]
}
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.gateway_name = AAZStrArg(
options=["--gateway-name"],
help="Unique identifier for this deployment",
required=True,
id_part="name",
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9-]{3,24}$",
),
)
_args_schema.resource_group = AAZResourceGroupNameArg(
required=True,
)
_args_schema.test_line_name = AAZStrArg(
options=["-n", "--name", "--test-line-name"],
help="Unique identifier for this test line",
required=True,
id_part="child_name_1",
fmt=AAZStrArgFormat(
pattern="^[a-zA-Z0-9-]{3,24}$",
),
)
return cls._args_schema
def _execute_operations(self):
self.pre_operations()
self.TestLinesGet(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 TestLinesGet(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.VoiceServices/communicationsGateways/{communicationsGatewayName}/testLines/{testLineName}",
**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(
"communicationsGatewayName", self.ctx.args.gateway_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,
),
**self.serialize_url_param(
"testLineName", self.ctx.args.test_line_name,
required=True,
),
}
return parameters
@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2023-01-31",
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.phone_number = AAZStrType(
serialized_name="phoneNumber",
flags={"required": True},
)
properties.provisioning_state = AAZStrType(
serialized_name="provisioningState",
)
properties.purpose = 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"]

Просмотреть файл

@ -0,0 +1,4 @@
{
"azext.isPreview": true,
"azext.minCliCoreVersion": "2.44.1"
}

Просмотреть файл

@ -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

Просмотреть файл

@ -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__)

Просмотреть файл

@ -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
# --------------------------------------------------------------------------------------------

Просмотреть файл

@ -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
# --------------------------------------------------------------------------------------------

Просмотреть файл

@ -0,0 +1,54 @@
interactions:
- request:
body: '{"name": "voicenametest", "type": "microsoft.voiceservices/communicationsgateways/testlines"}'
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
CommandName:
- voice-service check-name-availability
Connection:
- keep-alive
Content-Length:
- '93'
Content-Type:
- application/json
ParameterSetName:
- -l --name --type
User-Agent:
- AZURECLI/2.44.1 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0)
method: POST
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.VoiceServices/locations/centraluseuap/checkNameAvailability?api-version=2023-01-31
response:
body:
string: '{"nameAvailable":true}'
headers:
cache-control:
- no-cache
content-length:
- '22'
content-type:
- application/json; charset=utf-8
date:
- Mon, 06 Feb 2023 05:32:23 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-providerhub-traffic:
- 'True'
x-ms-ratelimit-remaining-subscription-writes:
- '1199'
status:
code: 200
message: OK
version: 1

Просмотреть файл

@ -0,0 +1,558 @@
interactions:
- request:
body: null
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
CommandName:
- voice-service gateway create
Connection:
- keep-alive
ParameterSetName:
- -n -g --service-locations --connectivity --codecs --e911-type --platforms
User-Agent:
- AZURECLI/2.44.1 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_voice_service_gateway000001?api-version=2021-04-01
response:
body:
string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_voice_service_gateway000001","name":"cli_test_voice_service_gateway000001","type":"Microsoft.Resources/resourceGroups","location":"centraluseuap","tags":{"product":"azurecli","cause":"automation","date":"2023-02-06T04:41:34Z"},"properties":{"provisioningState":"Succeeded"}}'
headers:
cache-control:
- no-cache
content-length:
- '357'
content-type:
- application/json; charset=utf-8
date:
- Mon, 06 Feb 2023 04:41:35 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": "centraluseuap", "properties": {"autoGeneratedDomainNameLabelScope":
"TenantReuse", "codecs": ["PCMA"], "connectivity": "PublicAddress", "e911Type":
"Standard", "emergencyDialStrings": ["911", "933"], "onPremMcpEnabled": false,
"platforms": ["OperatorConnect"], "serviceLocations": [{"name": "useast", "primaryRegionProperties":
{"allowedMediaSourceAddressPrefixes": ["10.1.2.0/24"], "allowedSignalingSourceAddressPrefixes":
["10.1.1.0/24"], "operatorAddresses": ["198.51.100.1"]}}, {"name": "useast2",
"primaryRegionProperties": {"allowedMediaSourceAddressPrefixes": ["10.2.2.0/24"],
"allowedSignalingSourceAddressPrefixes": ["10.2.1.0/24"], "operatorAddresses":
["198.51.100.2"]}}]}}'
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
CommandName:
- voice-service gateway create
Connection:
- keep-alive
Content-Length:
- '698'
Content-Type:
- application/json
ParameterSetName:
- -n -g --service-locations --connectivity --codecs --e911-type --platforms
User-Agent:
- AZURECLI/2.44.1 (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_voice_service_gateway000001/providers/Microsoft.VoiceServices/communicationsGateways/gateway000002?api-version=2023-01-31
response:
body:
string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_voice_service_gateway000001/providers/Microsoft.VoiceServices/communicationsGateways/gateway000002","name":"gateway000002","type":"microsoft.voiceservices/communicationsgateways","location":"centraluseuap","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-02-06T04:41:41.4158998Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-02-06T04:41:41.4158998Z"},"properties":{"autoGeneratedDomainNameLabelScope":"TenantReuse","codecs":["PCMA"],"connectivity":"PublicAddress","e911Type":"Standard","emergencyDialStrings":["911","933"],"onPremMcpEnabled":false,"platforms":["OperatorConnect"],"serviceLocations":[{"name":"useast","primaryRegionProperties":{"allowedMediaSourceAddressPrefixes":["10.1.2.0/24"],"allowedSignalingSourceAddressPrefixes":["10.1.1.0/24"],"operatorAddresses":["198.51.100.1"]}},{"name":"useast2","primaryRegionProperties":{"allowedMediaSourceAddressPrefixes":["10.2.2.0/24"],"allowedSignalingSourceAddressPrefixes":["10.2.1.0/24"],"operatorAddresses":["198.51.100.2"]}}],"provisioningState":"Accepted"}}'
headers:
azure-asyncoperation:
- https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.VoiceServices/locations/CENTRALUSEUAP/operationStatuses/3d1cc1f5-1b5d-4f23-ac61-68df733a3cff*2EF8EE69C583E7A4E9879970DB2701A745CA97D0D7C11E7D81B0E38BA8AEE145?api-version=2023-01-31
cache-control:
- no-cache
content-length:
- '1198'
content-type:
- application/json; charset=utf-8
date:
- Mon, 06 Feb 2023 04:41:44 GMT
etag:
- '"0000ae0b-0000-3300-0000-63e085060000"'
expires:
- '-1'
pragma:
- no-cache
request-context:
- appId=cid-v1:ee9ea8e7-bc71-4c0f-83ad-dc11c5b30732
strict-transport-security:
- max-age=31536000; includeSubDomains
vary:
- Accept-Encoding
x-content-type-options:
- nosniff
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:
- voice-service gateway create
Connection:
- keep-alive
ParameterSetName:
- -n -g --service-locations --connectivity --codecs --e911-type --platforms
User-Agent:
- AZURECLI/2.44.1 (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/providers/Microsoft.VoiceServices/locations/CENTRALUSEUAP/operationStatuses/3d1cc1f5-1b5d-4f23-ac61-68df733a3cff*2EF8EE69C583E7A4E9879970DB2701A745CA97D0D7C11E7D81B0E38BA8AEE145?api-version=2023-01-31
response:
body:
string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.VoiceServices/locations/CENTRALUSEUAP/operationStatuses/3d1cc1f5-1b5d-4f23-ac61-68df733a3cff*2EF8EE69C583E7A4E9879970DB2701A745CA97D0D7C11E7D81B0E38BA8AEE145","name":"3d1cc1f5-1b5d-4f23-ac61-68df733a3cff*2EF8EE69C583E7A4E9879970DB2701A745CA97D0D7C11E7D81B0E38BA8AEE145","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_voice_service_gateway000001/providers/Microsoft.VoiceServices/communicationsGateways/gateway000002","status":"Succeeded","startTime":"2023-02-06T04:41:42.3389638Z","properties":null}'
headers:
cache-control:
- no-cache
content-length:
- '621'
content-type:
- application/json; charset=utf-8
date:
- Mon, 06 Feb 2023 04:42:14 GMT
etag:
- '"0000800a-0000-3300-0000-63e0850c0000"'
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:
- voice-service gateway create
Connection:
- keep-alive
ParameterSetName:
- -n -g --service-locations --connectivity --codecs --e911-type --platforms
User-Agent:
- AZURECLI/2.44.1 (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_voice_service_gateway000001/providers/Microsoft.VoiceServices/communicationsGateways/gateway000002?api-version=2023-01-31
response:
body:
string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_voice_service_gateway000001/providers/Microsoft.VoiceServices/communicationsGateways/gateway000002","name":"gateway000002","type":"microsoft.voiceservices/communicationsgateways","location":"centraluseuap","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-02-06T04:41:41.4158998Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-02-06T04:41:41.4158998Z"},"properties":{"status":"ChangePending","apiBridge":null,"autoGeneratedDomainNameLabelScope":"TenantReuse","autoGeneratedDomainNameLabel":"gateway000002.e4hwabg0h3cdg4fu","codecs":["PCMA"],"connectivity":"PublicAddress","e911Type":"Standard","emergencyDialStrings":["911","933"],"onPremMcpEnabled":false,"platforms":["OperatorConnect"],"serviceLocations":[{"name":"useast","primaryRegionProperties":{"allowedMediaSourceAddressPrefixes":["10.1.2.0/24"],"allowedSignalingSourceAddressPrefixes":["10.1.1.0/24"],"operatorAddresses":["198.51.100.1"]}},{"name":"useast2","primaryRegionProperties":{"allowedMediaSourceAddressPrefixes":["10.2.2.0/24"],"allowedSignalingSourceAddressPrefixes":["10.2.1.0/24"],"operatorAddresses":["198.51.100.2"]}}],"provisioningState":"Succeeded"}}'
headers:
cache-control:
- no-cache
content-length:
- '1305'
content-type:
- application/json; charset=utf-8
date:
- Mon, 06 Feb 2023 04:42:15 GMT
etag:
- '"0000af0b-0000-3300-0000-63e0850c0000"'
expires:
- '-1'
pragma:
- no-cache
request-context:
- appId=cid-v1:ee9ea8e7-bc71-4c0f-83ad-dc11c5b30732
strict-transport-security:
- max-age=31536000; includeSubDomains
transfer-encoding:
- chunked
vary:
- Accept-Encoding,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:
- voice-service gateway update
Connection:
- keep-alive
ParameterSetName:
- -n -g --tags
User-Agent:
- AZURECLI/2.44.1 (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_voice_service_gateway000001/providers/Microsoft.VoiceServices/communicationsGateways/gateway000002?api-version=2023-01-31
response:
body:
string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_voice_service_gateway000001/providers/Microsoft.VoiceServices/communicationsGateways/gateway000002","name":"gateway000002","type":"microsoft.voiceservices/communicationsgateways","location":"centraluseuap","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-02-06T04:41:41.4158998Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-02-06T04:41:41.4158998Z"},"properties":{"status":"ChangePending","apiBridge":null,"autoGeneratedDomainNameLabelScope":"TenantReuse","autoGeneratedDomainNameLabel":"gateway000002.e4hwabg0h3cdg4fu","codecs":["PCMA"],"connectivity":"PublicAddress","e911Type":"Standard","emergencyDialStrings":["911","933"],"onPremMcpEnabled":false,"platforms":["OperatorConnect"],"serviceLocations":[{"name":"useast","primaryRegionProperties":{"allowedMediaSourceAddressPrefixes":["10.1.2.0/24"],"allowedSignalingSourceAddressPrefixes":["10.1.1.0/24"],"operatorAddresses":["198.51.100.1"]}},{"name":"useast2","primaryRegionProperties":{"allowedMediaSourceAddressPrefixes":["10.2.2.0/24"],"allowedSignalingSourceAddressPrefixes":["10.2.1.0/24"],"operatorAddresses":["198.51.100.2"]}}],"provisioningState":"Succeeded"}}'
headers:
cache-control:
- no-cache
content-length:
- '1305'
content-type:
- application/json; charset=utf-8
date:
- Mon, 06 Feb 2023 04:42:18 GMT
etag:
- '"0000af0b-0000-3300-0000-63e0850c0000"'
expires:
- '-1'
pragma:
- no-cache
request-context:
- appId=cid-v1:ee9ea8e7-bc71-4c0f-83ad-dc11c5b30732
strict-transport-security:
- max-age=31536000; includeSubDomains
transfer-encoding:
- chunked
vary:
- Accept-Encoding,Accept-Encoding
x-content-type-options:
- nosniff
x-ms-providerhub-traffic:
- 'True'
status:
code: 200
message: OK
- request:
body: '{"location": "centraluseuap", "properties": {"autoGeneratedDomainNameLabelScope":
"TenantReuse", "codecs": ["PCMA"], "connectivity": "PublicAddress", "e911Type":
"Standard", "emergencyDialStrings": ["911", "933"], "onPremMcpEnabled": false,
"platforms": ["OperatorConnect"], "provisioningState": "Succeeded", "serviceLocations":
[{"name": "useast", "primaryRegionProperties": {"allowedMediaSourceAddressPrefixes":
["10.1.2.0/24"], "allowedSignalingSourceAddressPrefixes": ["10.1.1.0/24"], "operatorAddresses":
["198.51.100.1"]}}, {"name": "useast2", "primaryRegionProperties": {"allowedMediaSourceAddressPrefixes":
["10.2.2.0/24"], "allowedSignalingSourceAddressPrefixes": ["10.2.1.0/24"], "operatorAddresses":
["198.51.100.2"]}}], "status": "ChangePending"}, "tags": {"tag": "test", "tag2":
"test2"}}'
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
CommandName:
- voice-service gateway update
Connection:
- keep-alive
Content-Length:
- '801'
Content-Type:
- application/json
ParameterSetName:
- -n -g --tags
User-Agent:
- AZURECLI/2.44.1 (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_voice_service_gateway000001/providers/Microsoft.VoiceServices/communicationsGateways/gateway000002?api-version=2023-01-31
response:
body:
string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_voice_service_gateway000001/providers/Microsoft.VoiceServices/communicationsGateways/gateway000002","name":"gateway000002","type":"microsoft.voiceservices/communicationsgateways","location":"centraluseuap","tags":{"tag":"test","tag2":"test2"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-02-06T04:41:41.4158998Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-02-06T04:42:19.1614601Z"},"properties":{"autoGeneratedDomainNameLabel":"gateway000002.e4hwabg0h3cdg4fu","autoGeneratedDomainNameLabelScope":"TenantReuse","codecs":["PCMA"],"connectivity":"PublicAddress","e911Type":"Standard","emergencyDialStrings":["911","933"],"onPremMcpEnabled":false,"platforms":["OperatorConnect"],"provisioningState":"Accepted","serviceLocations":[{"name":"useast","primaryRegionProperties":{"allowedMediaSourceAddressPrefixes":["10.1.2.0/24"],"allowedSignalingSourceAddressPrefixes":["10.1.1.0/24"],"operatorAddresses":["198.51.100.1"]}},{"name":"useast2","primaryRegionProperties":{"allowedMediaSourceAddressPrefixes":["10.2.2.0/24"],"allowedSignalingSourceAddressPrefixes":["10.2.1.0/24"],"operatorAddresses":["198.51.100.2"]}}],"status":"ChangePending"}}'
headers:
azure-asyncoperation:
- https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.VoiceServices/locations/CENTRALUSEUAP/operationStatuses/35cd234f-78d8-46b2-8b9a-c494928f3c42*2EF8EE69C583E7A4E9879970DB2701A745CA97D0D7C11E7D81B0E38BA8AEE145?api-version=2023-01-31
cache-control:
- no-cache
content-length:
- '1324'
content-type:
- application/json; charset=utf-8
date:
- Mon, 06 Feb 2023 04:42:22 GMT
etag:
- '"0000b00b-0000-3300-0000-63e0852b0000"'
expires:
- '-1'
pragma:
- no-cache
request-context:
- appId=cid-v1:ee9ea8e7-bc71-4c0f-83ad-dc11c5b30732
strict-transport-security:
- max-age=31536000; includeSubDomains
vary:
- Accept-Encoding
x-content-type-options:
- nosniff
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:
- voice-service gateway update
Connection:
- keep-alive
ParameterSetName:
- -n -g --tags
User-Agent:
- AZURECLI/2.44.1 (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/providers/Microsoft.VoiceServices/locations/CENTRALUSEUAP/operationStatuses/35cd234f-78d8-46b2-8b9a-c494928f3c42*2EF8EE69C583E7A4E9879970DB2701A745CA97D0D7C11E7D81B0E38BA8AEE145?api-version=2023-01-31
response:
body:
string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.VoiceServices/locations/CENTRALUSEUAP/operationStatuses/35cd234f-78d8-46b2-8b9a-c494928f3c42*2EF8EE69C583E7A4E9879970DB2701A745CA97D0D7C11E7D81B0E38BA8AEE145","name":"35cd234f-78d8-46b2-8b9a-c494928f3c42*2EF8EE69C583E7A4E9879970DB2701A745CA97D0D7C11E7D81B0E38BA8AEE145","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_voice_service_gateway000001/providers/Microsoft.VoiceServices/communicationsGateways/gateway000002","status":"Succeeded","startTime":"2023-02-06T04:42:19.4010041Z","properties":null}'
headers:
cache-control:
- no-cache
content-length:
- '621'
content-type:
- application/json; charset=utf-8
date:
- Mon, 06 Feb 2023 04:42:53 GMT
etag:
- '"0000840a-0000-3300-0000-63e085320000"'
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:
- voice-service gateway update
Connection:
- keep-alive
ParameterSetName:
- -n -g --tags
User-Agent:
- AZURECLI/2.44.1 (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_voice_service_gateway000001/providers/Microsoft.VoiceServices/communicationsGateways/gateway000002?api-version=2023-01-31
response:
body:
string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_voice_service_gateway000001/providers/Microsoft.VoiceServices/communicationsGateways/gateway000002","name":"gateway000002","type":"microsoft.voiceservices/communicationsgateways","location":"centraluseuap","tags":{"tag":"test","tag2":"test2"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-02-06T04:41:41.4158998Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-02-06T04:42:19.1614601Z"},"properties":{"status":"ChangePending","apiBridge":null,"autoGeneratedDomainNameLabelScope":"TenantReuse","autoGeneratedDomainNameLabel":"gateway000002.e4hwabg0h3cdg4fu","codecs":["PCMA"],"connectivity":"PublicAddress","e911Type":"Standard","emergencyDialStrings":["911","933"],"onPremMcpEnabled":false,"platforms":["OperatorConnect"],"provisioningState":"Succeeded","serviceLocations":[{"name":"useast","primaryRegionProperties":{"allowedMediaSourceAddressPrefixes":["10.1.2.0/24"],"allowedSignalingSourceAddressPrefixes":["10.1.1.0/24"],"operatorAddresses":["198.51.100.1"]}},{"name":"useast2","primaryRegionProperties":{"allowedMediaSourceAddressPrefixes":["10.2.2.0/24"],"allowedSignalingSourceAddressPrefixes":["10.2.1.0/24"],"operatorAddresses":["198.51.100.2"]}}]}}'
headers:
cache-control:
- no-cache
content-length:
- '1342'
content-type:
- application/json; charset=utf-8
date:
- Mon, 06 Feb 2023 04:42:53 GMT
etag:
- '"0000b10b-0000-3300-0000-63e085310000"'
expires:
- '-1'
pragma:
- no-cache
request-context:
- appId=cid-v1:ee9ea8e7-bc71-4c0f-83ad-dc11c5b30732
strict-transport-security:
- max-age=31536000; includeSubDomains
transfer-encoding:
- chunked
vary:
- Accept-Encoding,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:
- voice-service gateway list
Connection:
- keep-alive
ParameterSetName:
- -g
User-Agent:
- AZURECLI/2.44.1 (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_voice_service_gateway000001/providers/Microsoft.VoiceServices/communicationsGateways?api-version=2023-01-31
response:
body:
string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_voice_service_gateway000001/providers/Microsoft.VoiceServices/communicationsGateways/gateway000002","name":"gateway000002","type":"microsoft.voiceservices/communicationsgateways","location":"centraluseuap","tags":{"tag":"test","tag2":"test2"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-02-06T04:41:41.4158998Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-02-06T04:42:19.1614601Z"},"properties":{"apiBridge":null,"autoGeneratedDomainNameLabelScope":"TenantReuse","autoGeneratedDomainNameLabel":"gateway000002.e4hwabg0h3cdg4fu","codecs":["PCMA"],"connectivity":"PublicAddress","e911Type":"Standard","emergencyDialStrings":["911","933"],"onPremMcpEnabled":false,"platforms":["OperatorConnect"],"provisioningState":"Succeeded","serviceLocations":[{"name":"useast","primaryRegionProperties":{"allowedMediaSourceAddressPrefixes":["10.1.2.0/24"],"allowedSignalingSourceAddressPrefixes":["10.1.1.0/24"],"operatorAddresses":["198.51.100.1"]}},{"name":"useast2","primaryRegionProperties":{"allowedMediaSourceAddressPrefixes":["10.2.2.0/24"],"allowedSignalingSourceAddressPrefixes":["10.2.1.0/24"],"operatorAddresses":["198.51.100.2"]}}]}}]}'
headers:
cache-control:
- no-cache
content-length:
- '1329'
content-type:
- application/json; charset=utf-8
date:
- Mon, 06 Feb 2023 04:42:54 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:
- 272ca5a3-d9e3-4f7c-a849-9dea48dd7b65
- 180e0e2f-22d9-4816-a26e-985c55d91974
status:
code: 200
message: OK
- request:
body: null
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
CommandName:
- voice-service gateway show
Connection:
- keep-alive
ParameterSetName:
- -n -g
User-Agent:
- AZURECLI/2.44.1 (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_voice_service_gateway000001/providers/Microsoft.VoiceServices/communicationsGateways/gateway000002?api-version=2023-01-31
response:
body:
string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_voice_service_gateway000001/providers/Microsoft.VoiceServices/communicationsGateways/gateway000002","name":"gateway000002","type":"microsoft.voiceservices/communicationsgateways","location":"centraluseuap","tags":{"tag":"test","tag2":"test2"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-02-06T04:41:41.4158998Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-02-06T04:42:19.1614601Z"},"properties":{"status":"ChangePending","apiBridge":null,"autoGeneratedDomainNameLabelScope":"TenantReuse","autoGeneratedDomainNameLabel":"gateway000002.e4hwabg0h3cdg4fu","codecs":["PCMA"],"connectivity":"PublicAddress","e911Type":"Standard","emergencyDialStrings":["911","933"],"onPremMcpEnabled":false,"platforms":["OperatorConnect"],"provisioningState":"Succeeded","serviceLocations":[{"name":"useast","primaryRegionProperties":{"allowedMediaSourceAddressPrefixes":["10.1.2.0/24"],"allowedSignalingSourceAddressPrefixes":["10.1.1.0/24"],"operatorAddresses":["198.51.100.1"]}},{"name":"useast2","primaryRegionProperties":{"allowedMediaSourceAddressPrefixes":["10.2.2.0/24"],"allowedSignalingSourceAddressPrefixes":["10.2.1.0/24"],"operatorAddresses":["198.51.100.2"]}}]}}'
headers:
cache-control:
- no-cache
content-length:
- '1342'
content-type:
- application/json; charset=utf-8
date:
- Mon, 06 Feb 2023 04:42:57 GMT
etag:
- '"0000b10b-0000-3300-0000-63e085310000"'
expires:
- '-1'
pragma:
- no-cache
request-context:
- appId=cid-v1:ee9ea8e7-bc71-4c0f-83ad-dc11c5b30732
strict-transport-security:
- max-age=31536000; includeSubDomains
transfer-encoding:
- chunked
vary:
- Accept-Encoding,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:
- voice-service gateway delete
Connection:
- keep-alive
Content-Length:
- '0'
ParameterSetName:
- -n -g -y
User-Agent:
- AZURECLI/2.44.1 (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_voice_service_gateway000001/providers/Microsoft.VoiceServices/communicationsGateways/gateway000002?api-version=2023-01-31
response:
body:
string: ''
headers:
cache-control:
- no-cache
content-length:
- '0'
date:
- Mon, 06 Feb 2023 04:43:03 GMT
expires:
- '-1'
pragma:
- no-cache
request-context:
- appId=cid-v1:ee9ea8e7-bc71-4c0f-83ad-dc11c5b30732
strict-transport-security:
- max-age=31536000; includeSubDomains
vary:
- Accept-Encoding
x-content-type-options:
- nosniff
x-ms-providerhub-traffic:
- 'True'
x-ms-ratelimit-remaining-subscription-deletes:
- '14999'
status:
code: 200
message: OK
version: 1

Просмотреть файл

@ -0,0 +1,552 @@
interactions:
- request:
body: null
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
CommandName:
- voice-service gateway create
Connection:
- keep-alive
ParameterSetName:
- -n -g --service-locations --connectivity --codecs --e911-type --platforms
User-Agent:
- AZURECLI/2.44.1 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_voice_service_test_line000001?api-version=2021-04-01
response:
body:
string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_voice_service_test_line000001","name":"cli_test_voice_service_test_line000001","type":"Microsoft.Resources/resourceGroups","location":"centraluseuap","tags":{"product":"azurecli","cause":"automation","date":"2023-02-06T05:10:40Z"},"properties":{"provisioningState":"Succeeded"}}'
headers:
cache-control:
- no-cache
connection:
- close
content-length:
- '361'
content-type:
- application/json; charset=utf-8
date:
- Mon, 06 Feb 2023 05:10:45 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": "centraluseuap", "properties": {"autoGeneratedDomainNameLabelScope":
"TenantReuse", "codecs": ["PCMA"], "connectivity": "PublicAddress", "e911Type":
"Standard", "emergencyDialStrings": ["911", "933"], "onPremMcpEnabled": false,
"platforms": ["OperatorConnect"], "serviceLocations": [{"name": "useast", "primaryRegionProperties":
{"allowedMediaSourceAddressPrefixes": ["10.1.2.0/24"], "allowedSignalingSourceAddressPrefixes":
["10.1.1.0/24"], "operatorAddresses": ["198.51.100.1"]}}, {"name": "useast2",
"primaryRegionProperties": {"allowedMediaSourceAddressPrefixes": ["10.2.2.0/24"],
"allowedSignalingSourceAddressPrefixes": ["10.2.1.0/24"], "operatorAddresses":
["198.51.100.2"]}}]}}'
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
CommandName:
- voice-service gateway create
Connection:
- keep-alive
Content-Length:
- '698'
Content-Type:
- application/json
ParameterSetName:
- -n -g --service-locations --connectivity --codecs --e911-type --platforms
User-Agent:
- AZURECLI/2.44.1 (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_voice_service_test_line000001/providers/Microsoft.VoiceServices/communicationsGateways/gateway000002?api-version=2023-01-31
response:
body:
string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_voice_service_test_line000001/providers/Microsoft.VoiceServices/communicationsGateways/gateway000002","name":"gateway000002","type":"microsoft.voiceservices/communicationsgateways","location":"centraluseuap","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-02-06T05:10:50.0659244Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-02-06T05:10:50.0659244Z"},"properties":{"autoGeneratedDomainNameLabelScope":"TenantReuse","codecs":["PCMA"],"connectivity":"PublicAddress","e911Type":"Standard","emergencyDialStrings":["911","933"],"onPremMcpEnabled":false,"platforms":["OperatorConnect"],"serviceLocations":[{"name":"useast","primaryRegionProperties":{"allowedMediaSourceAddressPrefixes":["10.1.2.0/24"],"allowedSignalingSourceAddressPrefixes":["10.1.1.0/24"],"operatorAddresses":["198.51.100.1"]}},{"name":"useast2","primaryRegionProperties":{"allowedMediaSourceAddressPrefixes":["10.2.2.0/24"],"allowedSignalingSourceAddressPrefixes":["10.2.1.0/24"],"operatorAddresses":["198.51.100.2"]}}],"provisioningState":"Accepted"}}'
headers:
azure-asyncoperation:
- https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.VoiceServices/locations/CENTRALUSEUAP/operationStatuses/017b0deb-5723-41ff-942f-89d57abe5382*4E624E4FFD02FCBA6020028660027D06A5F0CBD0B0192FEB50A8A121BB996456?api-version=2023-01-31
cache-control:
- no-cache
content-length:
- '1200'
content-type:
- application/json; charset=utf-8
date:
- Mon, 06 Feb 2023 05:10:51 GMT
etag:
- '"0000bc0b-0000-3300-0000-63e08bdb0000"'
expires:
- '-1'
pragma:
- no-cache
request-context:
- appId=cid-v1:ee9ea8e7-bc71-4c0f-83ad-dc11c5b30732
strict-transport-security:
- max-age=31536000; includeSubDomains
vary:
- Accept-Encoding
x-content-type-options:
- nosniff
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:
- voice-service gateway create
Connection:
- keep-alive
ParameterSetName:
- -n -g --service-locations --connectivity --codecs --e911-type --platforms
User-Agent:
- AZURECLI/2.44.1 (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/providers/Microsoft.VoiceServices/locations/CENTRALUSEUAP/operationStatuses/017b0deb-5723-41ff-942f-89d57abe5382*4E624E4FFD02FCBA6020028660027D06A5F0CBD0B0192FEB50A8A121BB996456?api-version=2023-01-31
response:
body:
string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.VoiceServices/locations/CENTRALUSEUAP/operationStatuses/017b0deb-5723-41ff-942f-89d57abe5382*4E624E4FFD02FCBA6020028660027D06A5F0CBD0B0192FEB50A8A121BB996456","name":"017b0deb-5723-41ff-942f-89d57abe5382*4E624E4FFD02FCBA6020028660027D06A5F0CBD0B0192FEB50A8A121BB996456","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_voice_service_test_line000001/providers/Microsoft.VoiceServices/communicationsGateways/gateway000002","status":"Succeeded","startTime":"2023-02-06T05:10:51.0204151Z","properties":null}'
headers:
cache-control:
- no-cache
content-length:
- '623'
content-type:
- application/json; charset=utf-8
date:
- Mon, 06 Feb 2023 05:11:22 GMT
etag:
- '"00009e0a-0000-3300-0000-63e08be10000"'
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:
- voice-service gateway create
Connection:
- keep-alive
ParameterSetName:
- -n -g --service-locations --connectivity --codecs --e911-type --platforms
User-Agent:
- AZURECLI/2.44.1 (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_voice_service_test_line000001/providers/Microsoft.VoiceServices/communicationsGateways/gateway000002?api-version=2023-01-31
response:
body:
string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_voice_service_test_line000001/providers/Microsoft.VoiceServices/communicationsGateways/gateway000002","name":"gateway000002","type":"microsoft.voiceservices/communicationsgateways","location":"centraluseuap","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-02-06T05:10:50.0659244Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-02-06T05:10:50.0659244Z"},"properties":{"status":"ChangePending","apiBridge":null,"autoGeneratedDomainNameLabelScope":"TenantReuse","autoGeneratedDomainNameLabel":"gateway000002.b6apg6e2f4anbaa8","codecs":["PCMA"],"connectivity":"PublicAddress","e911Type":"Standard","emergencyDialStrings":["911","933"],"onPremMcpEnabled":false,"platforms":["OperatorConnect"],"serviceLocations":[{"name":"useast","primaryRegionProperties":{"allowedMediaSourceAddressPrefixes":["10.1.2.0/24"],"allowedSignalingSourceAddressPrefixes":["10.1.1.0/24"],"operatorAddresses":["198.51.100.1"]}},{"name":"useast2","primaryRegionProperties":{"allowedMediaSourceAddressPrefixes":["10.2.2.0/24"],"allowedSignalingSourceAddressPrefixes":["10.2.1.0/24"],"operatorAddresses":["198.51.100.2"]}}],"provisioningState":"Succeeded"}}'
headers:
cache-control:
- no-cache
content-length:
- '1307'
content-type:
- application/json; charset=utf-8
date:
- Mon, 06 Feb 2023 05:11:23 GMT
etag:
- '"0000bd0b-0000-3300-0000-63e08be10000"'
expires:
- '-1'
pragma:
- no-cache
request-context:
- appId=cid-v1:ee9ea8e7-bc71-4c0f-83ad-dc11c5b30732
strict-transport-security:
- max-age=31536000; includeSubDomains
transfer-encoding:
- chunked
vary:
- Accept-Encoding,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:
- voice-service test-line create
Connection:
- keep-alive
ParameterSetName:
- -n -g --gateway-name --phone-number --purpose
User-Agent:
- AZURECLI/2.44.1 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_voice_service_test_line000001?api-version=2021-04-01
response:
body:
string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_voice_service_test_line000001","name":"cli_test_voice_service_test_line000001","type":"Microsoft.Resources/resourceGroups","location":"centraluseuap","tags":{"product":"azurecli","cause":"automation","date":"2023-02-06T05:10:40Z"},"properties":{"provisioningState":"Succeeded"}}'
headers:
cache-control:
- no-cache
content-length:
- '361'
content-type:
- application/json; charset=utf-8
date:
- Mon, 06 Feb 2023 05:11:23 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": "centraluseuap", "properties": {"phoneNumber": "+1-555-1234",
"purpose": "Automated"}}'
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
CommandName:
- voice-service test-line create
Connection:
- keep-alive
Content-Length:
- '99'
Content-Type:
- application/json
ParameterSetName:
- -n -g --gateway-name --phone-number --purpose
User-Agent:
- AZURECLI/2.44.1 (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_voice_service_test_line000001/providers/Microsoft.VoiceServices/communicationsGateways/gateway000002/testLines/line000003?api-version=2023-01-31
response:
body:
string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_voice_service_test_line000001/providers/Microsoft.VoiceServices/communicationsGateways/gateway000002/testLines/line000003","name":"line000003","type":"microsoft.voiceservices/communicationsgateways/testlines","location":"centraluseuap","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-02-06T05:11:28.6691607Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-02-06T05:11:28.6691607Z"},"properties":{"phoneNumber":"+1-555-1234","purpose":"Automated","provisioningState":"Succeeded"}}'
headers:
cache-control:
- no-cache
content-length:
- '660'
content-type:
- application/json; charset=utf-8
date:
- Mon, 06 Feb 2023 05:11:31 GMT
etag:
- '"0000ce05-0000-3300-0000-63e08c010000"'
expires:
- '-1'
pragma:
- no-cache
request-context:
- appId=cid-v1:ee9ea8e7-bc71-4c0f-83ad-dc11c5b30732
strict-transport-security:
- max-age=31536000; includeSubDomains
transfer-encoding:
- chunked
vary:
- Accept-Encoding,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:
- voice-service test-line update
Connection:
- keep-alive
ParameterSetName:
- -n --gateway-name -g --tags
User-Agent:
- AZURECLI/2.44.1 (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_voice_service_test_line000001/providers/Microsoft.VoiceServices/communicationsGateways/gateway000002/testLines/line000003?api-version=2023-01-31
response:
body:
string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_voice_service_test_line000001/providers/Microsoft.VoiceServices/communicationsGateways/gateway000002/testLines/line000003","name":"line000003","type":"microsoft.voiceservices/communicationsgateways/testlines","location":"centraluseuap","systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-02-06T05:11:28.6691607Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-02-06T05:11:28.6691607Z"},"properties":{"phoneNumber":"+1-555-1234","purpose":"Automated","provisioningState":"Succeeded"}}'
headers:
cache-control:
- no-cache
content-length:
- '660'
content-type:
- application/json; charset=utf-8
date:
- Mon, 06 Feb 2023 05:11:33 GMT
etag:
- '"0000ce05-0000-3300-0000-63e08c010000"'
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": "centraluseuap", "properties": {"phoneNumber": "+1-555-1234",
"provisioningState": "Succeeded", "purpose": "Automated"}, "tags": {"tag": "test",
"tag2": "test2"}}'
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
CommandName:
- voice-service test-line update
Connection:
- keep-alive
Content-Length:
- '175'
Content-Type:
- application/json
ParameterSetName:
- -n --gateway-name -g --tags
User-Agent:
- AZURECLI/2.44.1 (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_voice_service_test_line000001/providers/Microsoft.VoiceServices/communicationsGateways/gateway000002/testLines/line000003?api-version=2023-01-31
response:
body:
string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_voice_service_test_line000001/providers/Microsoft.VoiceServices/communicationsGateways/gateway000002/testLines/line000003","name":"line000003","type":"microsoft.voiceservices/communicationsgateways/testlines","location":"centraluseuap","tags":{"tag":"test","tag2":"test2"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-02-06T05:11:28.6691607Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-02-06T05:11:34.2229929Z"},"properties":{"phoneNumber":"+1-555-1234","provisioningState":"Succeeded","purpose":"Automated"}}'
headers:
cache-control:
- no-cache
content-length:
- '697'
content-type:
- application/json; charset=utf-8
date:
- Mon, 06 Feb 2023 05:11:36 GMT
etag:
- '"0000cf05-0000-3300-0000-63e08c060000"'
expires:
- '-1'
pragma:
- no-cache
request-context:
- appId=cid-v1:ee9ea8e7-bc71-4c0f-83ad-dc11c5b30732
strict-transport-security:
- max-age=31536000; includeSubDomains
transfer-encoding:
- chunked
vary:
- Accept-Encoding,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:
- voice-service test-line list
Connection:
- keep-alive
ParameterSetName:
- --gateway-name -g
User-Agent:
- AZURECLI/2.44.1 (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_voice_service_test_line000001/providers/Microsoft.VoiceServices/communicationsGateways/gateway000002/testLines?api-version=2023-01-31
response:
body:
string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_voice_service_test_line000001/providers/Microsoft.VoiceServices/communicationsGateways/gateway000002/testLines/line000003","name":"line000003","type":"microsoft.voiceservices/communicationsgateways/testlines","location":"centraluseuap","tags":{"tag":"test","tag2":"test2"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-02-06T05:11:28.6691607Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-02-06T05:11:34.2229929Z"},"properties":{"phoneNumber":"+1-555-1234","provisioningState":"Succeeded","purpose":"Automated"}}]}'
headers:
cache-control:
- no-cache
content-length:
- '709'
content-type:
- application/json; charset=utf-8
date:
- Mon, 06 Feb 2023 05:11:39 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:
- 0ac805cb-a352-4188-861b-554c17964e9f
- 7982fad1-bcaf-4669-ba14-d034db417007
status:
code: 200
message: OK
- request:
body: null
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
CommandName:
- voice-service test-line show
Connection:
- keep-alive
ParameterSetName:
- -n -g --gateway-name
User-Agent:
- AZURECLI/2.44.1 (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_voice_service_test_line000001/providers/Microsoft.VoiceServices/communicationsGateways/gateway000002/testLines/line000003?api-version=2023-01-31
response:
body:
string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_voice_service_test_line000001/providers/Microsoft.VoiceServices/communicationsGateways/gateway000002/testLines/line000003","name":"line000003","type":"microsoft.voiceservices/communicationsgateways/testlines","location":"centraluseuap","tags":{"tag":"test","tag2":"test2"},"systemData":{"createdBy":"v-jingszhang@microsoft.com","createdByType":"User","createdAt":"2023-02-06T05:11:28.6691607Z","lastModifiedBy":"v-jingszhang@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-02-06T05:11:34.2229929Z"},"properties":{"phoneNumber":"+1-555-1234","provisioningState":"Succeeded","purpose":"Automated"}}'
headers:
cache-control:
- no-cache
content-length:
- '697'
content-type:
- application/json; charset=utf-8
date:
- Mon, 06 Feb 2023 05:11:41 GMT
etag:
- '"0000cf05-0000-3300-0000-63e08c060000"'
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:
- voice-service test-line delete
Connection:
- keep-alive
Content-Length:
- '0'
ParameterSetName:
- -n -g --gateway-name -y
User-Agent:
- AZURECLI/2.44.1 (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_voice_service_test_line000001/providers/Microsoft.VoiceServices/communicationsGateways/gateway000002/testLines/line000003?api-version=2023-01-31
response:
body:
string: ''
headers:
cache-control:
- no-cache
content-length:
- '0'
date:
- Mon, 06 Feb 2023 05:11:46 GMT
expires:
- '-1'
pragma:
- no-cache
request-context:
- appId=cid-v1:ee9ea8e7-bc71-4c0f-83ad-dc11c5b30732
strict-transport-security:
- max-age=31536000; includeSubDomains
vary:
- Accept-Encoding
x-content-type-options:
- nosniff
x-ms-providerhub-traffic:
- 'True'
x-ms-ratelimit-remaining-subscription-deletes:
- '14998'
status:
code: 200
message: OK
version: 1

Просмотреть файл

@ -0,0 +1,152 @@
# --------------------------------------------------------------------------------------------
# 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 VoiceServiceScenario(ScenarioTest):
@ResourceGroupPreparer(name_prefix='cli_test_voice_service_gateway', location='centraluseuap')
def test_voice_service_gateway(self, resource_group):
self.kwargs.update({
'gateway': self.create_random_name('gateway', 15),
})
self.cmd('voice-service gateway create -n {gateway} -g {rg} --service-locations [{{name:useast,PrimaryRegionProperties:{{operatorAddresses:[198.51.100.1],allowedSignalingSourceAddressPrefixes:[10.1.1.0/24],allowedMediaSourceAddressPrefixes:[10.1.2.0/24]}}}},{{name:useast2,PrimaryRegionProperties:{{operatorAddresses:[198.51.100.2],allowedSignalingSourceAddressPrefixes:[10.2.1.0/24],allowedMediaSourceAddressPrefixes:[10.2.2.0/24]}}}}] --connectivity PublicAddress --codecs [PCMA] --e911-type Standard --platforms [OperatorConnect]', checks=[
self.check('name', '{gateway}'),
self.check('resourceGroup', '{rg}'),
self.check('connectivity', 'PublicAddress'),
self.check('e911Type', 'Standard'),
self.check('emergencyDialStrings[0]', '911'),
self.check('emergencyDialStrings[1]', '933'),
self.check('platforms[0]', 'OperatorConnect'),
self.check('serviceLocations[0].name', 'useast'),
self.check('serviceLocations[0].primaryRegionProperties.allowedMediaSourceAddressPrefixes[0]', '10.1.2.0/24'),
self.check('serviceLocations[0].primaryRegionProperties.allowedSignalingSourceAddressPrefixes[0]', '10.1.1.0/24'),
self.check('serviceLocations[0].primaryRegionProperties.operatorAddresses[0]', '198.51.100.1'),
self.check('serviceLocations[1].name', 'useast2'),
self.check('serviceLocations[1].primaryRegionProperties.allowedMediaSourceAddressPrefixes[0]', '10.2.2.0/24'),
self.check('serviceLocations[1].primaryRegionProperties.allowedSignalingSourceAddressPrefixes[0]', '10.2.1.0/24'),
self.check('serviceLocations[1].primaryRegionProperties.operatorAddresses[0]', '198.51.100.2')
])
self.cmd('voice-service gateway update -n {gateway} -g {rg} --tags {{tag:test,tag2:test2}}', checks=[
self.check('name', '{gateway}'),
self.check('resourceGroup', '{rg}'),
self.check('connectivity', 'PublicAddress'),
self.check('e911Type', 'Standard'),
self.check('emergencyDialStrings[0]', '911'),
self.check('emergencyDialStrings[1]', '933'),
self.check('platforms[0]', 'OperatorConnect'),
self.check('serviceLocations[0].name', 'useast'),
self.check('serviceLocations[0].primaryRegionProperties.allowedMediaSourceAddressPrefixes[0]', '10.1.2.0/24'),
self.check('serviceLocations[0].primaryRegionProperties.allowedSignalingSourceAddressPrefixes[0]', '10.1.1.0/24'),
self.check('serviceLocations[0].primaryRegionProperties.operatorAddresses[0]', '198.51.100.1'),
self.check('serviceLocations[1].name', 'useast2'),
self.check('serviceLocations[1].primaryRegionProperties.allowedMediaSourceAddressPrefixes[0]', '10.2.2.0/24'),
self.check('serviceLocations[1].primaryRegionProperties.allowedSignalingSourceAddressPrefixes[0]', '10.2.1.0/24'),
self.check('serviceLocations[1].primaryRegionProperties.operatorAddresses[0]', '198.51.100.2'),
self.check('tags.tag', 'test'),
self.check('tags.tag2', 'test2')
])
self.cmd('voice-service gateway list -g {rg}', checks=[
self.check('[0].name', '{gateway}'),
self.check('[0].resourceGroup', '{rg}'),
self.check('[0].connectivity', 'PublicAddress'),
self.check('[0].e911Type', 'Standard'),
self.check('[0].emergencyDialStrings[0]', '911'),
self.check('[0].emergencyDialStrings[1]', '933'),
self.check('[0].platforms[0]', 'OperatorConnect'),
self.check('[0].serviceLocations[0].name', 'useast'),
self.check('[0].serviceLocations[0].primaryRegionProperties.allowedMediaSourceAddressPrefixes[0]', '10.1.2.0/24'),
self.check('[0].serviceLocations[0].primaryRegionProperties.allowedSignalingSourceAddressPrefixes[0]', '10.1.1.0/24'),
self.check('[0].serviceLocations[0].primaryRegionProperties.operatorAddresses[0]', '198.51.100.1'),
self.check('[0].serviceLocations[1].name', 'useast2'),
self.check('[0].serviceLocations[1].primaryRegionProperties.allowedMediaSourceAddressPrefixes[0]', '10.2.2.0/24'),
self.check('[0].serviceLocations[1].primaryRegionProperties.allowedSignalingSourceAddressPrefixes[0]', '10.2.1.0/24'),
self.check('[0].serviceLocations[1].primaryRegionProperties.operatorAddresses[0]', '198.51.100.2'),
self.check('[0].tags.tag', 'test'),
self.check('[0].tags.tag2', 'test2')
])
self.cmd('voice-service gateway show -n {gateway} -g {rg}', checks=[
self.check('name', '{gateway}'),
self.check('resourceGroup', '{rg}'),
self.check('connectivity', 'PublicAddress'),
self.check('e911Type', 'Standard'),
self.check('emergencyDialStrings[0]', '911'),
self.check('emergencyDialStrings[1]', '933'),
self.check('platforms[0]', 'OperatorConnect'),
self.check('serviceLocations[0].name', 'useast'),
self.check('serviceLocations[0].primaryRegionProperties.allowedMediaSourceAddressPrefixes[0]', '10.1.2.0/24'),
self.check('serviceLocations[0].primaryRegionProperties.allowedSignalingSourceAddressPrefixes[0]', '10.1.1.0/24'),
self.check('serviceLocations[0].primaryRegionProperties.operatorAddresses[0]', '198.51.100.1'),
self.check('serviceLocations[1].name', 'useast2'),
self.check('serviceLocations[1].primaryRegionProperties.allowedMediaSourceAddressPrefixes[0]', '10.2.2.0/24'),
self.check('serviceLocations[1].primaryRegionProperties.allowedSignalingSourceAddressPrefixes[0]', '10.2.1.0/24'),
self.check('serviceLocations[1].primaryRegionProperties.operatorAddresses[0]', '198.51.100.2'),
self.check('tags.tag', 'test'),
self.check('tags.tag2', 'test2')
])
self.cmd('voice-service gateway delete -n {gateway} -g {rg} -y')
@ResourceGroupPreparer(name_prefix='cli_test_voice_service_test_line', location='centraluseuap')
def test_voice_service_test_line(self, resource_group):
self.kwargs.update({
'gateway': self.create_random_name('gateway', 15),
'testline': self.create_random_name('line', 10)
})
self.cmd('voice-service gateway create -n {gateway} -g {rg} --service-locations [{{name:useast,PrimaryRegionProperties:{{operatorAddresses:[198.51.100.1],allowedSignalingSourceAddressPrefixes:[10.1.1.0/24],allowedMediaSourceAddressPrefixes:[10.1.2.0/24]}}}},{{name:useast2,PrimaryRegionProperties:{{operatorAddresses:[198.51.100.2],allowedSignalingSourceAddressPrefixes:[10.2.1.0/24],allowedMediaSourceAddressPrefixes:[10.2.2.0/24]}}}}] --connectivity PublicAddress --codecs [PCMA] --e911-type Standard --platforms [OperatorConnect]', checks=[
self.check('name', '{gateway}'),
self.check('resourceGroup', '{rg}'),
self.check('connectivity', 'PublicAddress'),
self.check('e911Type', 'Standard'),
self.check('emergencyDialStrings[0]', '911'),
self.check('emergencyDialStrings[1]', '933'),
self.check('platforms[0]', 'OperatorConnect'),
self.check('serviceLocations[0].name', 'useast'),
self.check('serviceLocations[0].primaryRegionProperties.allowedMediaSourceAddressPrefixes[0]', '10.1.2.0/24'),
self.check('serviceLocations[0].primaryRegionProperties.allowedSignalingSourceAddressPrefixes[0]', '10.1.1.0/24'),
self.check('serviceLocations[0].primaryRegionProperties.operatorAddresses[0]', '198.51.100.1'),
self.check('serviceLocations[1].name', 'useast2'),
self.check('serviceLocations[1].primaryRegionProperties.allowedMediaSourceAddressPrefixes[0]', '10.2.2.0/24'),
self.check('serviceLocations[1].primaryRegionProperties.allowedSignalingSourceAddressPrefixes[0]', '10.2.1.0/24'),
self.check('serviceLocations[1].primaryRegionProperties.operatorAddresses[0]', '198.51.100.2')
])
self.cmd('voice-service test-line create -n {testline} -g {rg} --gateway-name {gateway} --phone-number +1-555-1234 --purpose Automated', checks=[
self.check('name', '{testline}'),
self.check('resourceGroup', '{rg}'),
self.check('phoneNumber', '+1-555-1234'),
self.check('purpose', 'Automated')
])
self.cmd('voice-service test-line update -n {testline} --gateway-name {gateway} -g {rg} --tags {{tag:test,tag2:test2}}', checks=[
self.check('name', '{testline}'),
self.check('resourceGroup', '{rg}'),
self.check('phoneNumber', '+1-555-1234'),
self.check('purpose', 'Automated'),
self.check('tags.tag', 'test'),
self.check('tags.tag2', 'test2')
])
self.cmd('voice-service test-line list --gateway-name {gateway} -g {rg}', checks=[
self.check('[0].name', '{testline}'),
self.check('[0].resourceGroup', '{rg}'),
self.check('[0].phoneNumber', '+1-555-1234'),
self.check('[0].purpose', 'Automated'),
self.check('[0].tags.tag', 'test'),
self.check('[0].tags.tag2', 'test2')
])
self.cmd('voice-service test-line show -n {testline} -g {rg} --gateway-name {gateway}', checks=[
self.check('name', '{testline}'),
self.check('resourceGroup', '{rg}'),
self.check('phoneNumber', '+1-555-1234'),
self.check('purpose', 'Automated'),
self.check('tags.tag', 'test'),
self.check('tags.tag2', 'test2')
])
self.cmd('voice-service test-line delete -n {testline} -g {rg} --gateway-name {gateway} -y')
@ResourceGroupPreparer(name_prefix='cli_test_voice_check_name_availability', location='centraluseuap')
def test_voice_service_check_name_availability(self, resource_group):
self.cmd('voice-service check-name-availability -l centraluseuap --name voicenametest --type microsoft.voiceservices/communicationsgateways/testlines', checks=[
self.check('nameAvailable', True)
])

Просмотреть файл

@ -0,0 +1 @@
#setup.cfg

Просмотреть файл

@ -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='voice-service',
version=VERSION,
description='Microsoft Azure Command-Line Tools VoiceService 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/voice-service',
classifiers=CLASSIFIERS,
packages=find_packages(exclude=["tests"]),
package_data={'azext_voice_service': ['azext_metadata.json']},
install_requires=DEPENDENCIES
)