Update CNAME. This is a helper call to update_object.

    Find a CNAME ``_ref`` then call update_object with the record data.

    CLI Example:

    .. code-block:: bash

        salt-call infoblox.update_cname name=example.example.com data="{
                'canonical':'example-ha-0.example.com',
                'use_ttl':true,
                'ttl':200,
                'comment':'Salt managed CNAME'}"

def update_cname(name, data, **api_opts):
    '''
    Update CNAME. This is a helper call to update_object.

    Find a CNAME ``_ref`` then call update_object with the record data.

    CLI Example:

    .. code-block:: bash

        salt-call infoblox.update_cname name=example.example.com data="{
                'canonical':'example-ha-0.example.com',
                'use_ttl':true,
                'ttl':200,
                'comment':'Salt managed CNAME'}"
    '''
    o = get_cname(name=name, **api_opts)
    if not o:
        raise Exception('CNAME record not found')
    return update_object(objref=o['_ref'], data=data, **api_opts)