示例#1
0
def update_profile(instance, tags=None):
    if instance.sku.name in (SkuName.premium_azure_front_door, SkuName.standard_azure_front_door):
        logger.warning('Standard_AzureFrontDoor and Premium_AzureFrontDoor are only supported for AFD profiles')
        raise ResourceNotFoundError("Operation returned an invalid status code 'Not Found'")

    params = ProfileUpdateParameters(tags=tags)
    _update_mapper(instance, params, ['tags'])
    return params
示例#2
0
def update_afd_profile(client: ProfilesOperations, resource_group_name,
                       profile_name, tags):
    profile = client.get(resource_group_name, profile_name)
    if profile.sku.name not in (SkuName.premium_azure_front_door,
                                SkuName.standard_azure_front_door):
        logger.warning(
            'Unexpected SKU type, only Standard_AzureFrontDoor and Premium_AzureFrontDoor are supported'
        )
        raise ResourceNotFoundError(
            "Operation returned an invalid status code 'Not Found'")

    return client.begin_update(resource_group_name, profile_name,
                               ProfileUpdateParameters(tags=tags))
示例#3
0
def update_profile(instance, tags=None):
    params = ProfileUpdateParameters(tags=tags)
    _update_mapper(instance, params, ['tags'])
    return params