mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-23 10:51:24 -07:00
Fixes some NIC problems: create without nsg, support loadbalancer (#38643)
* add loadbalancer * dict check nullable * add default vallue when get list * create backend addr pool * fix the set * fix to dict * fix ideponement * use param security group name when create * nic can has no nsg * add test * fix * fix * fix * add document * add configuration * fix * fix * remove all resources * fix * fix test * add version added * fix lint * fix lint * Fixes some NIC bugs (#39213) * add loadbalancer * dict check nullable * add default vallue when get list * create backend addr pool * fix the set * fix to dict * fix ideponement * use param security group name when create * nic can has no nsg * add test * fix * fix * fix * fix idemponet * add document * fix test * add configuration * fix * fix * remove all resources * fix * fix test * add version added * fix lint * fix lint * fix lint * remove new feature and only submit bugfix * remove useless test * fix * fix indent * Update azure_rm_networkinterface.py * fix comment * support 3 types to specific name and resource group * avoid test racing * fix test * add sample * add resource id test
This commit is contained in:
parent
4fbdc1a497
commit
c95724fb0a
3 changed files with 186 additions and 70 deletions
|
@ -132,7 +132,7 @@ try:
|
|||
from msrestazure.azure_active_directory import AADTokenCredentials
|
||||
from msrestazure.azure_exceptions import CloudError
|
||||
from msrestazure.azure_active_directory import MSIAuthentication
|
||||
from msrestazure.tools import resource_id, is_valid_resource_id
|
||||
from msrestazure.tools import parse_resource_id, resource_id, is_valid_resource_id
|
||||
from msrestazure import azure_cloud
|
||||
from azure.common.credentials import ServicePrincipalCredentials, UserPassCredentials
|
||||
from azure.mgmt.network.version import VERSION as network_client_version
|
||||
|
@ -651,6 +651,17 @@ class AzureRMModuleBase(object):
|
|||
|
||||
return None
|
||||
|
||||
def parse_resource_to_dict(self, resource):
|
||||
'''
|
||||
Return a dict of the give resource, which contains name and resource group.
|
||||
|
||||
:param resource: It can be a resource name, id or a dict contains name and resource group.
|
||||
'''
|
||||
resource_dict = parse_resource_id(resource) if not isinstance(resource, dict) else resource
|
||||
resource_dict['resource_group'] = resource_dict.get('resource_group', self.resource_group)
|
||||
resource_dict['subscription_id'] = resource_dict.get('subscription_id', self.subscription_id)
|
||||
return resource_dict
|
||||
|
||||
def serialize_obj(self, obj, class_name, enum_modules=None):
|
||||
'''
|
||||
Return a JSON representation of an Azure object.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue