Пример #1
0
def create_resource_group(rg_name, location, tags=None):
    ''' Create a new resource group.
    :param str resource_group_name:the desired resource group name
    :param str location:the resource group location
    :param str tags:tags in 'a=b c' format
    '''
    rcf = _resource_client_factory()

    parameters = ResourceGroup(location=location, tags=tags)
    return rcf.resource_groups.create_or_update(rg_name, parameters)
Пример #2
0
def create_resource_group(resource_group_name, location, tags=None):
    ''' Create a new resource group.
    :param str resource_group_name:the desired resource group name
    :param str location:the resource group location
    :param str tags:tags in 'a=b;c' format
    '''
    rcf = _resource_client_factory()

    if rcf.resource_groups.check_existence(resource_group_name):
        raise CLIError(
            'resource group {} already exists'.format(resource_group_name))
    parameters = ResourceGroup(location=location, tags=tags)
    return rcf.resource_groups.create_or_update(resource_group_name,
                                                parameters)