change to x-ms-client-flattening

This commit is contained in:
qiaozha 2020-02-21 17:54:18 +08:00
Родитель af3f119ba4
Коммит 23cc593f80
13 изменённых файлов: 212 добавлений и 241 удалений

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

@ -26,7 +26,7 @@ pipeline:
#output-artifact: source-file-pynamer
az/aznamer:
input: az/clicommon
output-artifact: source-file-aznamer
#output-artifact: source-file-aznamer
az/modifiers:
input: az/aznamer
#output-artifact: source-file-modifiers
@ -36,7 +36,7 @@ pipeline:
az/emitter:
input:
#- az/clicommon
- az/aznamer
#- az/aznamer
#- az/modifiers
- az/azgenerator
scope: scope-az
@ -47,7 +47,7 @@ scope-az:
is-object: false
output-artifact:
#- source-file-pynamer
- source-file-aznamer
#- source-file-aznamer
#- source-file-modifiers
- source-file-extension

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

@ -89,7 +89,8 @@
"schema": {
"$ref": "#/definitions/ManagedNetwork"
},
"description": "Parameters supplied to the create/update a Managed Network Resource"
"description": "Parameters supplied to the create/update a Managed Network Resource",
"x-ms-client-flatten": true
},
{
"$ref": "#/parameters/ApiVersionParameter"
@ -191,7 +192,8 @@
"schema": {
"$ref": "#/definitions/ManagedNetworkUpdate"
},
"description": "Parameters supplied to update application gateway tags and/or scope."
"description": "Parameters supplied to update application gateway tags and/or scope.",
"x-ms-client-flatten": true
},
{
"$ref": "#/parameters/ApiVersionParameter"
@ -391,7 +393,8 @@
"schema": {
"$ref": "#/definitions/ScopeAssignment"
},
"description": "Parameters supplied to the specify which Managed Network this scope is being assigned"
"description": "Parameters supplied to the specify which Managed Network this scope is being assigned",
"x-ms-client-flatten": true
},
{
"name": "scope",
@ -581,7 +584,8 @@
"schema": {
"$ref": "#/definitions/ManagedNetworkGroup"
},
"description": "Parameters supplied to the create/update a Managed Network Group resource"
"description": "Parameters supplied to the create/update a Managed Network Group resource",
"x-ms-client-flatten": true
},
{
"$ref": "#/parameters/ApiVersionParameter"
@ -789,7 +793,8 @@
"schema": {
"$ref": "#/definitions/ManagedNetworkPeeringPolicy"
},
"description": "Parameters supplied to create/update a Managed Network Peering Policy"
"description": "Parameters supplied to create/update a Managed Network Peering Policy",
"x-ms-client-flatten": true
},
{
"$ref": "#/parameters/ApiVersionParameter"

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

@ -8,18 +8,16 @@
from azure.cli.core.commands.parameters import (
tags_type,
get_enum_type,
resource_group_name_type,
get_location_type
)
from azext_managed_network.actions import (
AddScope,
AddManagementGroups,
AddSubscriptions,
AddVirtualNetworks,
AddSubnets,
AddManagedNetworkGroup,
AddSpokes,
AddMesh
AddProperties
)
@ -39,10 +37,7 @@ def load_arguments(self, _):
c.argument('managed_network_name', id_part=None, help='The name of the Managed Network.')
c.argument('location', arg_type=get_location_type(self.cli_ctx))
c.argument('tags', tags_type, nargs='+')
c.argument('scope_management_groups', id_part=None, help='The collection of management groups covered by the Managed Network', action=AddManagementGroups, nargs='+')
c.argument('scope_subscriptions', id_part=None, help='The collection of subscriptions covered by the Managed Network', action=AddSubscriptions, nargs='+')
c.argument('scope_virtual_networks', id_part=None, help='The collection of virtual nets covered by the Managed Network', action=AddVirtualNetworks, nargs='+')
c.argument('scope_subnets', id_part=None, help='The collection of subnets covered by the Managed Network', action=AddSubnets, nargs='+')
c.argument('scope', id_part=None, help='Scope of a Managed Network', action=AddScope, nargs='+')
with self.argument_context('managed-network managed-networks update') as c:
c.argument('resource_group_name', resource_group_name_type)
@ -91,13 +86,21 @@ def load_arguments(self, _):
c.argument('resource_group_name', resource_group_name_type)
c.argument('managed_network_name', id_part=None, help='The name of the Managed Network.')
c.argument('managed_network_group_name', id_part=None, help='The name of the Managed Network Group.')
c.argument('managed_network_group', id_part=None, help='Parameters supplied to the create/update a Managed Network Group resource', action=AddManagedNetworkGroup, nargs='+')
c.argument('location', arg_type=get_location_type(self.cli_ctx))
c.argument('management_groups', id_part=None, help='The collection of management groups covered by the Managed Network', action=AddManagementGroups, nargs='+')
c.argument('subscriptions', id_part=None, help='The collection of subscriptions covered by the Managed Network', action=AddSubscriptions, nargs='+')
c.argument('virtual_networks', id_part=None, help='The collection of virtual nets covered by the Managed Network', action=AddVirtualNetworks, nargs='+')
c.argument('subnets', id_part=None, help='The collection of subnets covered by the Managed Network', action=AddSubnets, nargs='+')
with self.argument_context('managed-network managed-network-groups update') as c:
c.argument('resource_group_name', resource_group_name_type)
c.argument('managed_network_name', id_part=None, help='The name of the Managed Network.')
c.argument('managed_network_group_name', id_part=None, help='The name of the Managed Network Group.')
c.argument('managed_network_group', id_part=None, help='Parameters supplied to the create/update a Managed Network Group resource', action=AddManagedNetworkGroup, nargs='+')
c.argument('location', arg_type=get_location_type(self.cli_ctx))
c.argument('management_groups', id_part=None, help='The collection of management groups covered by the Managed Network', action=AddManagementGroups, nargs='+')
c.argument('subscriptions', id_part=None, help='The collection of subscriptions covered by the Managed Network', action=AddSubscriptions, nargs='+')
c.argument('virtual_networks', id_part=None, help='The collection of virtual nets covered by the Managed Network', action=AddVirtualNetworks, nargs='+')
c.argument('subnets', id_part=None, help='The collection of subnets covered by the Managed Network', action=AddSubnets, nargs='+')
with self.argument_context('managed-network managed-network-groups delete') as c:
c.argument('resource_group_name', resource_group_name_type)
@ -120,20 +123,14 @@ def load_arguments(self, _):
c.argument('managed_network_name', id_part=None, help='The name of the Managed Network.')
c.argument('managed_network_peering_policy_name', id_part=None, help='The name of the Managed Network Peering Policy.')
c.argument('location', arg_type=get_location_type(self.cli_ctx))
c.argument('properties_type', arg_type=get_enum_type(['HubAndSpokeTopology', 'MeshTopology']), id_part=None, help='Gets or sets the connectivity type of a network structure policy')
c.argument('id', id_part=None, help='Resource Id')
c.argument('properties_spokes', id_part=None, help='Gets or sets the spokes group IDs', action=AddSpokes, nargs='+')
c.argument('properties_mesh', id_part=None, help='Gets or sets the mesh group IDs', action=AddMesh, nargs='+')
c.argument('properties', id_part=None, help='Properties of a Managed Network Peering Policy', action=AddProperties, nargs='+')
with self.argument_context('managed-network managed-network-peering-policies update') as c:
c.argument('resource_group_name', resource_group_name_type)
c.argument('managed_network_name', id_part=None, help='The name of the Managed Network.')
c.argument('managed_network_peering_policy_name', id_part=None, help='The name of the Managed Network Peering Policy.')
c.argument('location', arg_type=get_location_type(self.cli_ctx))
c.argument('properties_type', arg_type=get_enum_type(['HubAndSpokeTopology', 'MeshTopology']), id_part=None, help='Gets or sets the connectivity type of a network structure policy')
c.argument('id', id_part=None, help='Resource Id')
c.argument('properties_spokes', id_part=None, help='Gets or sets the spokes group IDs', action=AddSpokes, nargs='+')
c.argument('properties_mesh', id_part=None, help='Gets or sets the mesh group IDs', action=AddMesh, nargs='+')
c.argument('properties', id_part=None, help='Properties of a Managed Network Peering Policy', action=AddProperties, nargs='+')
with self.argument_context('managed-network managed-network-peering-policies delete') as c:
c.argument('resource_group_name', resource_group_name_type)

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

@ -22,6 +22,74 @@ class AddManagedNetwork(argparse._AppendAction):
return d
class AddScope(argparse._AppendAction):
def __call__(self, parser, namespace, values, option_string=None):
action = self.get_action(values, option_string)
super(ImageBuilderAddCustomize, self).__call__(parser, namespace, action, option_string)
def get_action(self, values, option_string): # pylint: disable=no-self-use
try:
properties = dict(x.split('=', 1) for x in values)
except ValueError:
raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string))
d = {}
for k in properties:
kl = k.lower()
v = properties[k]
return d
class AddParameters(argparse._AppendAction):
def __call__(self, parser, namespace, values, option_string=None):
action = self.get_action(values, option_string)
super(ImageBuilderAddCustomize, self).__call__(parser, namespace, action, option_string)
def get_action(self, values, option_string): # pylint: disable=no-self-use
try:
properties = dict(x.split('=', 1) for x in values)
except ValueError:
raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string))
d = {}
for k in properties:
kl = k.lower()
v = properties[k]
return d
class AddParameters(argparse._AppendAction):
def __call__(self, parser, namespace, values, option_string=None):
action = self.get_action(values, option_string)
super(ImageBuilderAddCustomize, self).__call__(parser, namespace, action, option_string)
def get_action(self, values, option_string): # pylint: disable=no-self-use
try:
properties = dict(x.split('=', 1) for x in values)
except ValueError:
raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string))
d = {}
for k in properties:
kl = k.lower()
v = properties[k]
return d
class AddManagedNetworkGroup(argparse._AppendAction):
def __call__(self, parser, namespace, values, option_string=None):
action = self.get_action(values, option_string)
super(ImageBuilderAddCustomize, self).__call__(parser, namespace, action, option_string)
def get_action(self, values, option_string): # pylint: disable=no-self-use
try:
properties = dict(x.split('=', 1) for x in values)
except ValueError:
raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string))
d = {}
for k in properties:
kl = k.lower()
v = properties[k]
return d
class AddManagementGroups(argparse._AppendAction):
def __call__(self, parser, namespace, values, option_string=None):
action = self.get_action(values, option_string)
@ -90,57 +158,6 @@ class AddSubnets(argparse._AppendAction):
return d
class AddParameters(argparse._AppendAction):
def __call__(self, parser, namespace, values, option_string=None):
action = self.get_action(values, option_string)
super(ImageBuilderAddCustomize, self).__call__(parser, namespace, action, option_string)
def get_action(self, values, option_string): # pylint: disable=no-self-use
try:
properties = dict(x.split('=', 1) for x in values)
except ValueError:
raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string))
d = {}
for k in properties:
kl = k.lower()
v = properties[k]
return d
class AddParameters(argparse._AppendAction):
def __call__(self, parser, namespace, values, option_string=None):
action = self.get_action(values, option_string)
super(ImageBuilderAddCustomize, self).__call__(parser, namespace, action, option_string)
def get_action(self, values, option_string): # pylint: disable=no-self-use
try:
properties = dict(x.split('=', 1) for x in values)
except ValueError:
raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string))
d = {}
for k in properties:
kl = k.lower()
v = properties[k]
return d
class AddManagedNetworkGroup(argparse._AppendAction):
def __call__(self, parser, namespace, values, option_string=None):
action = self.get_action(values, option_string)
super(ImageBuilderAddCustomize, self).__call__(parser, namespace, action, option_string)
def get_action(self, values, option_string): # pylint: disable=no-self-use
try:
properties = dict(x.split('=', 1) for x in values)
except ValueError:
raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string))
d = {}
for k in properties:
kl = k.lower()
v = properties[k]
return d
class AddManagedNetworkPolicy(argparse._AppendAction):
def __call__(self, parser, namespace, values, option_string=None):
action = self.get_action(values, option_string)
@ -158,24 +175,7 @@ class AddManagedNetworkPolicy(argparse._AppendAction):
return d
class AddSpokes(argparse._AppendAction):
def __call__(self, parser, namespace, values, option_string=None):
action = self.get_action(values, option_string)
super(ImageBuilderAddCustomize, self).__call__(parser, namespace, action, option_string)
def get_action(self, values, option_string): # pylint: disable=no-self-use
try:
properties = dict(x.split('=', 1) for x in values)
except ValueError:
raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string))
d = {}
for k in properties:
kl = k.lower()
v = properties[k]
return d
class AddMesh(argparse._AppendAction):
class AddProperties(argparse._AppendAction):
def __call__(self, parser, namespace, values, option_string=None):
action = self.get_action(values, option_string)
super(ImageBuilderAddCustomize, self).__call__(parser, namespace, action, option_string)

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

@ -29,18 +29,8 @@ def managed_network_managed_networks_create(cmd, client,
managed_network_name,
location=None,
tags=None,
scope_management_groups=None,
scope_subscriptions=None,
scope_virtual_networks=None,
scope_subnets=None):
managed_network = {}
managed_network['location'] = location # string
managed_network['tags'] = tags
managed_network.setdefault('scope', {})['management_groups'] = None if scope_management_groups is None else scope_management_groups
managed_network.setdefault('scope', {})['subscriptions'] = None if scope_subscriptions is None else scope_subscriptions
managed_network.setdefault('scope', {})['virtual_networks'] = None if scope_virtual_networks is None else scope_virtual_networks
managed_network.setdefault('scope', {})['subnets'] = None if scope_subnets is None else scope_subnets
return client.create_or_update(resource_group_name=resource_group_name, managed_network_name=managed_network_name, managed_network=managed_network)
scope=None):
return client.create_or_update(resource_group_name=resource_group_name, managed_network_name=managed_network_name, location=location, tags=tags, scope=scope)
def managed_network_managed_networks_update(cmd, client,
@ -72,10 +62,7 @@ def managed_network_scope_assignments_create(cmd, client,
scope_assignment_name,
location=None,
assigned_managed_network=None):
parameters = {}
parameters['location'] = location # string
parameters['assigned_managed_network'] = assigned_managed_network # string
return client.create_or_update(scope=scope, scope_assignment_name=scope_assignment_name, parameters=parameters)
return client.create_or_update(scope=scope, scope_assignment_name=scope_assignment_name, location=location, assigned_managed_network=assigned_managed_network)
def managed_network_scope_assignments_update(cmd, client,
@ -83,10 +70,7 @@ def managed_network_scope_assignments_update(cmd, client,
scope_assignment_name,
location=None,
assigned_managed_network=None):
parameters = {}
parameters['location'] = location # string
parameters['assigned_managed_network'] = assigned_managed_network # string
return client.create_or_update(scope=scope, scope_assignment_name=scope_assignment_name, parameters=parameters)
return client.create_or_update(scope=scope, scope_assignment_name=scope_assignment_name, location=location, assigned_managed_network=assigned_managed_network)
def managed_network_scope_assignments_delete(cmd, client,
@ -114,16 +98,24 @@ def managed_network_managed_network_groups_create(cmd, client,
resource_group_name,
managed_network_name,
managed_network_group_name,
managed_network_group):
return client.create_or_update(resource_group_name=resource_group_name, managed_network_name=managed_network_name, managed_network_group_name=managed_network_group_name, managed_network_group=managed_network_group)
location=None,
management_groups=None,
subscriptions=None,
virtual_networks=None,
subnets=None):
return client.create_or_update(resource_group_name=resource_group_name, managed_network_name=managed_network_name, managed_network_group_name=managed_network_group_name, location=location, management_groups=management_groups, subscriptions=subscriptions, virtual_networks=virtual_networks, subnets=subnets)
def managed_network_managed_network_groups_update(cmd, client,
resource_group_name,
managed_network_name,
managed_network_group_name,
managed_network_group):
return client.create_or_update(resource_group_name=resource_group_name, managed_network_name=managed_network_name, managed_network_group_name=managed_network_group_name, managed_network_group=managed_network_group)
location=None,
management_groups=None,
subscriptions=None,
virtual_networks=None,
subnets=None):
return client.create_or_update(resource_group_name=resource_group_name, managed_network_name=managed_network_name, managed_network_group_name=managed_network_group_name, location=location, management_groups=management_groups, subscriptions=subscriptions, virtual_networks=virtual_networks, subnets=subnets)
def managed_network_managed_network_groups_delete(cmd, client,
@ -152,36 +144,18 @@ def managed_network_managed_network_peering_policies_create(cmd, client,
resource_group_name,
managed_network_name,
managed_network_peering_policy_name,
properties_type,
location=None,
id=None,
properties_spokes=None,
properties_mesh=None):
managed_network_policy = {}
managed_network_policy['location'] = location # string
managed_network_policy.setdefault('properties', {})['type'] = properties_type # choice
managed_network_policy['id'] = id # string
managed_network_policy.setdefault('properties', {})['spokes'] = None if properties_spokes is None else properties_spokes
managed_network_policy.setdefault('properties', {})['mesh'] = None if properties_mesh is None else properties_mesh
return client.create_or_update(resource_group_name=resource_group_name, managed_network_name=managed_network_name, managed_network_peering_policy_name=managed_network_peering_policy_name, managed_network_policy=managed_network_policy)
properties=None):
return client.create_or_update(resource_group_name=resource_group_name, managed_network_name=managed_network_name, managed_network_peering_policy_name=managed_network_peering_policy_name, location=location, properties=properties)
def managed_network_managed_network_peering_policies_update(cmd, client,
resource_group_name,
managed_network_name,
managed_network_peering_policy_name,
properties_type,
location=None,
id=None,
properties_spokes=None,
properties_mesh=None):
managed_network_policy = {}
managed_network_policy['location'] = location # string
managed_network_policy.setdefault('properties', {})['type'] = properties_type # choice
managed_network_policy['id'] = id # string
managed_network_policy.setdefault('properties', {})['spokes'] = None if properties_spokes is None else properties_spokes
managed_network_policy.setdefault('properties', {})['mesh'] = None if properties_mesh is None else properties_mesh
return client.create_or_update(resource_group_name=resource_group_name, managed_network_name=managed_network_name, managed_network_peering_policy_name=managed_network_peering_policy_name, managed_network_policy=managed_network_policy)
properties=None):
return client.create_or_update(resource_group_name=resource_group_name, managed_network_name=managed_network_name, managed_network_peering_policy_name=managed_network_peering_policy_name, location=location, properties=properties)
def managed_network_managed_network_peering_policies_delete(cmd, client,

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

@ -39,8 +39,6 @@ class ManagedNetworkManagementClientScenarioTest(ScenarioTest):
self.cmd('az managed-network managed-network-peering-policies create '
'--managed-network-name "myManagedNetwork" '
'--managed-network-peering-policy-name "myHubAndSpoke" '
'--type "HubAndSpokeTopology" '
'--id "/subscriptionB/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myHubVnet" '
'--resource-group-name {rg}',
checks=[])

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

@ -3,7 +3,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.0.6198, generator: {generator})
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union
from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union
import warnings
from azure.core.async_paging import AsyncItemPaged, AsyncList
@ -103,11 +103,17 @@ class ManagedNetworkGroupsOperations:
resource_group_name: str,
managed_network_name: str,
managed_network_group_name: str,
managed_network_group: "models.ManagedNetworkGroup",
location: Optional[str] = None,
management_groups: Optional[List["ResourceId"]] = None,
subscriptions: Optional[List["ResourceId"]] = None,
virtual_networks: Optional[List["ResourceId"]] = None,
subnets: Optional[List["ResourceId"]] = None,
**kwargs
) -> "models.ManagedNetworkGroup":
cls: ClsType["models.ManagedNetworkGroup"] = kwargs.pop('cls', None )
error_map = kwargs.pop('error_map', {})
managed_network_group = models.ManagedNetworkGroup(location=location, management_groups=management_groups, subscriptions=subscriptions, virtual_networks=virtual_networks, subnets=subnets)
api_version = "2019-06-01-preview"
# Construct URL
@ -159,7 +165,11 @@ class ManagedNetworkGroupsOperations:
resource_group_name: str,
managed_network_name: str,
managed_network_group_name: str,
managed_network_group: "models.ManagedNetworkGroup",
location: Optional[str] = None,
management_groups: Optional[List["ResourceId"]] = None,
subscriptions: Optional[List["ResourceId"]] = None,
virtual_networks: Optional[List["ResourceId"]] = None,
subnets: Optional[List["ResourceId"]] = None,
**kwargs
) -> "models.ManagedNetworkGroup":
"""The Put ManagedNetworkGroups operation creates or updates a Managed Network Group resource.
@ -170,9 +180,16 @@ class ManagedNetworkGroupsOperations:
:type managed_network_name: str
:param managed_network_group_name: The name of the Managed Network Group.
:type managed_network_group_name: str
:param managed_network_group: Parameters supplied to the create/update a Managed Network Group
resource.
:type managed_network_group: ~managed_network_management_client.models.ManagedNetworkGroup
:param location: The geo-location where the resource lives.
:type location: str
:param management_groups: The collection of management groups covered by the Managed Network.
:type management_groups: list[~managed_network_management_client.models.ResourceId]
:param subscriptions: The collection of subscriptions covered by the Managed Network.
:type subscriptions: list[~managed_network_management_client.models.ResourceId]
:param virtual_networks: The collection of virtual nets covered by the Managed Network.
:type virtual_networks: list[~managed_network_management_client.models.ResourceId]
:param subnets: The collection of subnets covered by the Managed Network.
:type subnets: list[~managed_network_management_client.models.ResourceId]
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword polling: True for ARMPolling, False for no polling, or a
polling object for personal polling strategy
@ -188,7 +205,11 @@ class ManagedNetworkGroupsOperations:
resource_group_name=resource_group_name,
managed_network_name=managed_network_name,
managed_network_group_name=managed_network_group_name,
managed_network_group=managed_network_group,
location=location,
management_groups=management_groups,
subscriptions=subscriptions,
virtual_networks=virtual_networks,
subnets=subnets,
cls=lambda x,y,z: x,
**kwargs
)

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

@ -3,7 +3,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.0.6198, generator: {generator})
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union
from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union
import warnings
from azure.core.async_paging import AsyncItemPaged, AsyncList
@ -103,17 +103,14 @@ class ManagedNetworkPeeringPoliciesOperations:
resource_group_name: str,
managed_network_name: str,
managed_network_peering_policy_name: str,
type: Union[str, "models.Type"],
location: Optional[str] = None,
id: Optional[str] = None,
spokes: Optional[List["ResourceId"]] = None,
mesh: Optional[List["ResourceId"]] = None,
properties: Optional["models.ManagedNetworkPeeringPolicyProperties"] = None,
**kwargs
) -> "models.ManagedNetworkPeeringPolicy":
cls: ClsType["models.ManagedNetworkPeeringPolicy"] = kwargs.pop('cls', None )
error_map = kwargs.pop('error_map', {})
managed_network_policy = models.ManagedNetworkPeeringPolicy(location=location, type=type, id=id, spokes=spokes, mesh=mesh)
managed_network_policy = models.ManagedNetworkPeeringPolicy(location=location, properties=properties)
api_version = "2019-06-01-preview"
# Construct URL
@ -165,11 +162,8 @@ class ManagedNetworkPeeringPoliciesOperations:
resource_group_name: str,
managed_network_name: str,
managed_network_peering_policy_name: str,
type: Union[str, "models.Type"],
location: Optional[str] = None,
id: Optional[str] = None,
spokes: Optional[List["ResourceId"]] = None,
mesh: Optional[List["ResourceId"]] = None,
properties: Optional["models.ManagedNetworkPeeringPolicyProperties"] = None,
**kwargs
) -> "models.ManagedNetworkPeeringPolicy":
"""The Put ManagedNetworkPeeringPolicies operation creates/updates a new Managed Network Peering Policy.
@ -180,16 +174,10 @@ class ManagedNetworkPeeringPoliciesOperations:
:type managed_network_name: str
:param managed_network_peering_policy_name: The name of the Managed Network Peering Policy.
:type managed_network_peering_policy_name: str
:param type: Gets or sets the connectivity type of a network structure policy.
:type type: str or ~managed_network_management_client.models.Type
:param location: The geo-location where the resource lives.
:type location: str
:param id: Resource Id.
:type id: str
:param spokes: Gets or sets the spokes group IDs.
:type spokes: list[~managed_network_management_client.models.ResourceId]
:param mesh: Gets or sets the mesh group IDs.
:type mesh: list[~managed_network_management_client.models.ResourceId]
:param properties: Properties of a Managed Network Peering Policy.
:type properties: ~managed_network_management_client.models.ManagedNetworkPeeringPolicyProperties
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword polling: True for ARMPolling, False for no polling, or a
polling object for personal polling strategy
@ -205,11 +193,8 @@ class ManagedNetworkPeeringPoliciesOperations:
resource_group_name=resource_group_name,
managed_network_name=managed_network_name,
managed_network_peering_policy_name=managed_network_peering_policy_name,
type=type,
location=location,
id=id,
spokes=spokes,
mesh=mesh,
properties=properties,
cls=lambda x,y,z: x,
**kwargs
)

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

@ -3,7 +3,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.0.6198, generator: {generator})
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union
from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union
import warnings
from azure.core.async_paging import AsyncItemPaged, AsyncList
@ -100,10 +100,7 @@ class ManagedNetworksOperations:
managed_network_name: str,
location: Optional[str] = None,
tags: Optional[Dict[str, str]] = None,
management_groups: Optional[List["ResourceId"]] = None,
subscriptions: Optional[List["ResourceId"]] = None,
virtual_networks: Optional[List["ResourceId"]] = None,
subnets: Optional[List["ResourceId"]] = None,
scope: Optional["models.Scope"] = None,
**kwargs
) -> "models.ManagedNetwork":
"""The Put ManagedNetworks operation creates/updates a Managed Network Resource, specified by resource group and Managed Network name.
@ -116,14 +113,8 @@ class ManagedNetworksOperations:
:type location: str
:param tags: Resource tags.
:type tags: dict[str, str]
:param management_groups: The collection of management groups covered by the Managed Network.
:type management_groups: list[~managed_network_management_client.models.ResourceId]
:param subscriptions: The collection of subscriptions covered by the Managed Network.
:type subscriptions: list[~managed_network_management_client.models.ResourceId]
:param virtual_networks: The collection of virtual nets covered by the Managed Network.
:type virtual_networks: list[~managed_network_management_client.models.ResourceId]
:param subnets: The collection of subnets covered by the Managed Network.
:type subnets: list[~managed_network_management_client.models.ResourceId]
:param scope: Scope of a Managed Network.
:type scope: ~managed_network_management_client.models.Scope
:keyword callable cls: A custom type or function that will be passed the direct response
:return: ManagedNetwork or ManagedNetwork or the result of cls(response)
:rtype: ~managed_network_management_client.models.ManagedNetwork or ~managed_network_management_client.models.ManagedNetwork
@ -132,7 +123,7 @@ class ManagedNetworksOperations:
cls: ClsType["models.ManagedNetwork"] = kwargs.pop('cls', None )
error_map = kwargs.pop('error_map', {})
managed_network = models.ManagedNetwork(location=location, tags=tags, management_groups=management_groups, subscriptions=subscriptions, virtual_networks=virtual_networks, subnets=subnets)
managed_network = models.ManagedNetwork(location=location, tags=tags, scope=scope)
api_version = "2019-06-01-preview"
# Construct URL

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

@ -3,7 +3,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.0.6198, generator: {generator})
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union
from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union
import warnings
from azure.core.exceptions import map_error
@ -104,12 +104,18 @@ class ManagedNetworkGroupsOperations(object):
resource_group_name, # type: str
managed_network_name, # type: str
managed_network_group_name, # type: str
managed_network_group, # type: "models.ManagedNetworkGroup"
location=None, # type: Optional[str]
management_groups=None, # type: Optional[List["ResourceId"]]
subscriptions=None, # type: Optional[List["ResourceId"]]
virtual_networks=None, # type: Optional[List["ResourceId"]]
subnets=None, # type: Optional[List["ResourceId"]]
**kwargs # type: Any
):
# type: (...) -> "models.ManagedNetworkGroup"
cls = kwargs.pop('cls', None ) # type: ClsType["models.ManagedNetworkGroup"]
error_map = kwargs.pop('error_map', {})
managed_network_group = models.ManagedNetworkGroup(location=location, management_groups=management_groups, subscriptions=subscriptions, virtual_networks=virtual_networks, subnets=subnets)
api_version = "2019-06-01-preview"
# Construct URL
@ -161,7 +167,11 @@ class ManagedNetworkGroupsOperations(object):
resource_group_name, # type: str
managed_network_name, # type: str
managed_network_group_name, # type: str
managed_network_group, # type: "models.ManagedNetworkGroup"
location=None, # type: Optional[str]
management_groups=None, # type: Optional[List["ResourceId"]]
subscriptions=None, # type: Optional[List["ResourceId"]]
virtual_networks=None, # type: Optional[List["ResourceId"]]
subnets=None, # type: Optional[List["ResourceId"]]
**kwargs # type: Any
):
# type: (...) -> "models.ManagedNetworkGroup"
@ -173,9 +183,16 @@ class ManagedNetworkGroupsOperations(object):
:type managed_network_name: str
:param managed_network_group_name: The name of the Managed Network Group.
:type managed_network_group_name: str
:param managed_network_group: Parameters supplied to the create/update a Managed Network Group
resource.
:type managed_network_group: ~managed_network_management_client.models.ManagedNetworkGroup
:param location: The geo-location where the resource lives.
:type location: str
:param management_groups: The collection of management groups covered by the Managed Network.
:type management_groups: list[~managed_network_management_client.models.ResourceId]
:param subscriptions: The collection of subscriptions covered by the Managed Network.
:type subscriptions: list[~managed_network_management_client.models.ResourceId]
:param virtual_networks: The collection of virtual nets covered by the Managed Network.
:type virtual_networks: list[~managed_network_management_client.models.ResourceId]
:param subnets: The collection of subnets covered by the Managed Network.
:type subnets: list[~managed_network_management_client.models.ResourceId]
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword polling: True for ARMPolling, False for no polling, or a
polling object for personal polling strategy
@ -191,7 +208,11 @@ class ManagedNetworkGroupsOperations(object):
resource_group_name=resource_group_name,
managed_network_name=managed_network_name,
managed_network_group_name=managed_network_group_name,
managed_network_group=managed_network_group,
location=location,
management_groups=management_groups,
subscriptions=subscriptions,
virtual_networks=virtual_networks,
subnets=subnets,
cls=lambda x,y,z: x,
**kwargs
)

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

@ -3,7 +3,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.0.6198, generator: {generator})
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union
from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union
import warnings
from azure.core.exceptions import map_error
@ -104,18 +104,15 @@ class ManagedNetworkPeeringPoliciesOperations(object):
resource_group_name, # type: str
managed_network_name, # type: str
managed_network_peering_policy_name, # type: str
type, # type: Union[str, "models.Type"]
location=None, # type: Optional[str]
id=None, # type: Optional[str]
spokes=None, # type: Optional[List["ResourceId"]]
mesh=None, # type: Optional[List["ResourceId"]]
properties=None, # type: Optional["models.ManagedNetworkPeeringPolicyProperties"]
**kwargs # type: Any
):
# type: (...) -> "models.ManagedNetworkPeeringPolicy"
cls = kwargs.pop('cls', None ) # type: ClsType["models.ManagedNetworkPeeringPolicy"]
error_map = kwargs.pop('error_map', {})
managed_network_policy = models.ManagedNetworkPeeringPolicy(location=location, type=type, id=id, spokes=spokes, mesh=mesh)
managed_network_policy = models.ManagedNetworkPeeringPolicy(location=location, properties=properties)
api_version = "2019-06-01-preview"
# Construct URL
@ -167,11 +164,8 @@ class ManagedNetworkPeeringPoliciesOperations(object):
resource_group_name, # type: str
managed_network_name, # type: str
managed_network_peering_policy_name, # type: str
type, # type: Union[str, "models.Type"]
location=None, # type: Optional[str]
id=None, # type: Optional[str]
spokes=None, # type: Optional[List["ResourceId"]]
mesh=None, # type: Optional[List["ResourceId"]]
properties=None, # type: Optional["models.ManagedNetworkPeeringPolicyProperties"]
**kwargs # type: Any
):
# type: (...) -> "models.ManagedNetworkPeeringPolicy"
@ -183,16 +177,10 @@ class ManagedNetworkPeeringPoliciesOperations(object):
:type managed_network_name: str
:param managed_network_peering_policy_name: The name of the Managed Network Peering Policy.
:type managed_network_peering_policy_name: str
:param type: Gets or sets the connectivity type of a network structure policy.
:type type: str or ~managed_network_management_client.models.Type
:param location: The geo-location where the resource lives.
:type location: str
:param id: Resource Id.
:type id: str
:param spokes: Gets or sets the spokes group IDs.
:type spokes: list[~managed_network_management_client.models.ResourceId]
:param mesh: Gets or sets the mesh group IDs.
:type mesh: list[~managed_network_management_client.models.ResourceId]
:param properties: Properties of a Managed Network Peering Policy.
:type properties: ~managed_network_management_client.models.ManagedNetworkPeeringPolicyProperties
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword polling: True for ARMPolling, False for no polling, or a
polling object for personal polling strategy
@ -208,11 +196,8 @@ class ManagedNetworkPeeringPoliciesOperations(object):
resource_group_name=resource_group_name,
managed_network_name=managed_network_name,
managed_network_peering_policy_name=managed_network_peering_policy_name,
type=type,
location=location,
id=id,
spokes=spokes,
mesh=mesh,
properties=properties,
cls=lambda x,y,z: x,
**kwargs
)

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

@ -3,7 +3,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.0.6198, generator: {generator})
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union
from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union
import warnings
from azure.core.exceptions import map_error
@ -101,10 +101,7 @@ class ManagedNetworksOperations(object):
managed_network_name, # type: str
location=None, # type: Optional[str]
tags=None, # type: Optional[Dict[str, str]]
management_groups=None, # type: Optional[List["ResourceId"]]
subscriptions=None, # type: Optional[List["ResourceId"]]
virtual_networks=None, # type: Optional[List["ResourceId"]]
subnets=None, # type: Optional[List["ResourceId"]]
scope=None, # type: Optional["models.Scope"]
**kwargs # type: Any
):
# type: (...) -> "models.ManagedNetwork"
@ -118,14 +115,8 @@ class ManagedNetworksOperations(object):
:type location: str
:param tags: Resource tags.
:type tags: dict[str, str]
:param management_groups: The collection of management groups covered by the Managed Network.
:type management_groups: list[~managed_network_management_client.models.ResourceId]
:param subscriptions: The collection of subscriptions covered by the Managed Network.
:type subscriptions: list[~managed_network_management_client.models.ResourceId]
:param virtual_networks: The collection of virtual nets covered by the Managed Network.
:type virtual_networks: list[~managed_network_management_client.models.ResourceId]
:param subnets: The collection of subnets covered by the Managed Network.
:type subnets: list[~managed_network_management_client.models.ResourceId]
:param scope: Scope of a Managed Network.
:type scope: ~managed_network_management_client.models.Scope
:keyword callable cls: A custom type or function that will be passed the direct response
:return: ManagedNetwork or ManagedNetwork or the result of cls(response)
:rtype: ~managed_network_management_client.models.ManagedNetwork or ~managed_network_management_client.models.ManagedNetwork
@ -134,7 +125,7 @@ class ManagedNetworksOperations(object):
cls = kwargs.pop('cls', None ) # type: ClsType["models.ManagedNetwork"]
error_map = kwargs.pop('error_map', {})
managed_network = models.ManagedNetwork(location=location, tags=tags, management_groups=management_groups, subscriptions=subscriptions, virtual_networks=virtual_networks, subnets=subnets)
managed_network = models.ManagedNetwork(location=location, tags=tags, scope=scope)
api_version = "2019-06-01-preview"
# Construct URL

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

@ -8,6 +8,12 @@ create a managed-network managed-network-groups.
|------|----|-----------|----------|--------------|
|**--api-version**|constant|Api Version|/something/my_option|/something/myOption|
|**--managed-network-group**|object|Parameters supplied to the create/update a Managed Network Group resource|/something/my_option|/something/myOption|
|--location**|string|The geo-location where the resource lives|/something/my_option|/something/myOption|
|--kind**|constant|Responsibility role under which this Managed Network Group will be created|/something/my_option|/something/myOption|
|--management-groups**|array|The collection of management groups covered by the Managed Network|/something/my_option|/something/myOption|
|--subscriptions**|array|The collection of subscriptions covered by the Managed Network|/something/my_option|/something/myOption|
|--virtual-networks**|array|The collection of virtual nets covered by the Managed Network|/something/my_option|/something/myOption|
|--subnets**|array|The collection of subnets covered by the Managed Network|/something/my_option|/something/myOption|
### managed-network managed-network-groups delete
delete a managed-network managed-network-groups.
@ -39,6 +45,12 @@ create a managed-network managed-network-groups.
|------|----|-----------|----------|--------------|
|**--api-version**|constant|Api Version|/something/my_option|/something/myOption|
|**--managed-network-group**|object|Parameters supplied to the create/update a Managed Network Group resource|/something/my_option|/something/myOption|
|--location**|string|The geo-location where the resource lives|/something/my_option|/something/myOption|
|--kind**|constant|Responsibility role under which this Managed Network Group will be created|/something/my_option|/something/myOption|
|--management-groups**|array|The collection of management groups covered by the Managed Network|/something/my_option|/something/myOption|
|--subscriptions**|array|The collection of subscriptions covered by the Managed Network|/something/my_option|/something/myOption|
|--virtual-networks**|array|The collection of virtual nets covered by the Managed Network|/something/my_option|/something/myOption|
|--subnets**|array|The collection of subnets covered by the Managed Network|/something/my_option|/something/myOption|
### managed-network managed-network-peering-policies create
create a managed-network managed-network-peering-policies.
@ -47,11 +59,8 @@ create a managed-network managed-network-peering-policies.
|------|----|-----------|----------|--------------|
|**--api-version**|constant|Api Version|/something/my_option|/something/myOption|
|**--managed-network-policy**|object|Parameters supplied to create/update a Managed Network Peering Policy|/something/my_option|/something/myOption|
|**--type**|choice|Gets or sets the connectivity type of a network structure policy|/something/my_option|/something/myOption|
|--location**|string|The geo-location where the resource lives|/something/my_option|/something/myOption|
|--id**|string|Resource Id|/something/my_option|/something/myOption|
|--spokes**|array|Gets or sets the spokes group IDs|/something/my_option|/something/myOption|
|--mesh**|array|Gets or sets the mesh group IDs|/something/my_option|/something/myOption|
|--properties**|object|Properties of a Managed Network Peering Policy|/something/my_option|/something/myOption|
### managed-network managed-network-peering-policies delete
delete a managed-network managed-network-peering-policies.
@ -83,11 +92,8 @@ create a managed-network managed-network-peering-policies.
|------|----|-----------|----------|--------------|
|**--api-version**|constant|Api Version|/something/my_option|/something/myOption|
|**--managed-network-policy**|object|Parameters supplied to create/update a Managed Network Peering Policy|/something/my_option|/something/myOption|
|**--type**|choice|Gets or sets the connectivity type of a network structure policy|/something/my_option|/something/myOption|
|--location**|string|The geo-location where the resource lives|/something/my_option|/something/myOption|
|--id**|string|Resource Id|/something/my_option|/something/myOption|
|--spokes**|array|Gets or sets the spokes group IDs|/something/my_option|/something/myOption|
|--mesh**|array|Gets or sets the mesh group IDs|/something/my_option|/something/myOption|
|--properties**|object|Properties of a Managed Network Peering Policy|/something/my_option|/something/myOption|
### managed-network managed-networks create
create a managed-network managed-networks.
@ -98,10 +104,7 @@ create a managed-network managed-networks.
|**--managed-network**|object|Parameters supplied to the create/update a Managed Network Resource|/something/my_option|/something/myOption|
|--location**|string|The geo-location where the resource lives|/something/my_option|/something/myOption|
|--tags**|dictionary|Resource tags|/something/my_option|/something/myOption|
|--management-groups**|array|The collection of management groups covered by the Managed Network|/something/my_option|/something/myOption|
|--subscriptions**|array|The collection of subscriptions covered by the Managed Network|/something/my_option|/something/myOption|
|--virtual-networks**|array|The collection of virtual nets covered by the Managed Network|/something/my_option|/something/myOption|
|--subnets**|array|The collection of subnets covered by the Managed Network|/something/my_option|/something/myOption|
|--scope**|object|Scope of a Managed Network|/something/my_option|/something/myOption|
### managed-network managed-networks delete
delete a managed-network managed-networks.