예제 #1
0
def unlink_entities(soap_client,
                    id_one=0,
                    id_two=0,
                    properties=[],
                    version='8.1.0'):
    try:
        return soap_client.service.unlinkEntities(id_one, id_two, properties)
    except WebFault as e:
        raise api_exception(e.message)
def get_linked_entities(soap_client,
                        entity_id,
                        type,
                        start=0,
                        count=100,
                        version='8.1.0'):
    try:
        return soap_client.service.getLinkedEntities(entity_id, type, start,
                                                     count)
    except WebFault as e:
        raise api_exception(e.message)
예제 #3
0
def delete_entity(soap_client, id, version='8.1.0'):
    """
    Deletes an object using the generic delete() method

    :param soap_client:
    :param id:
    :return:
    """
    try:
        return soap_client.service.delete(id)
    except WebFault as e:
        raise api_exception(e.message)
def get_parent(soap_client, id, version='8.1.0'):
    """
    Returns the APIEntity for the parent entity with its properties fields populated

    :param soap_client:
    :param id:  The id of the entity whose parent you want to retrieve
    :return:
    """
    try:
        return soap_client.service.getParent(id)
    except WebFault as e:
        raise api_exception(e.message)
def get_entity_by_id(soap_client, id):
    """
    Returns objects from the database referenced by their database ID and with its properties fields populated

    :param soap_client:
    :param id:
    :return:
    """
    try:
        return soap_client.service.getEntityById(id)
    except WebFault as e:
        raise api_exception(e.message)
예제 #6
0
def update_entity(soap_client, api_entity, version='8.1.0'):
    """
    Generic method for updating an object

    :param soap_client:
    :param api_entity:  The actual API entity passed as an entire object that has its mutable
                        values updated
    :return:
    """
    try:
        return soap_client.service.update(api_entity)
    except WebFault as e:
        raise api_exception(e.message)
def get_entity_by_name(soap_client, parent_id, name, type, version='8.1.0'):
    """
    Returns objects from the database referenced by their name field

    :param soap_client:
    :param parent_id:
    :param name:
    :param type:
    :return:
    """
    try:
        return soap_client.service.getEntityByName(parent_id, name, type)
    except WebFault as e:
        raise api_exception(e.message)
예제 #8
0
def add_entity(soap_client, parent, entity_object, version='8.1.0'):
    """
    A generic method for adding configurations, DNS zones, and DNS resource records.
    When using addEntity() to add a zone, you must specify a single zone name without any . (dot)
    characters.

    :param self:
    :param parent:
    :param entity_object:
    :return:    the object ID for the new configuration
    """
    try:
        return soap_client.service.addEntity(parent, entity_object)
    except WebFault as e:
        raise api_exception(e.message)
def get_entities(soap_client, parent_id, type, start, count, version='8.1.0'):
    """
    Returns an array of requested child objects for a given parent_id value

    :param soap_client:
    :param parent_id:
    :param type:
    :param start:
    :param count:
    :return:
    """
    try:
        return soap_client.service.getEntities(parent_id, type, start, count)
    except WebFault as e:
        raise api_exception(e.message)
def add_user(soap_client, username, password, properties='', version='8.1.0'):
    try:
        return soap_client.service.addUser(username, password, properties)
    except WebFault as e:
        raise api_exception(e.message)
def add_user_group(soap_client, name, properties='', version='8.1.0'):
    try:
        return soap_client.service.addUserGroup(name, properties)
    except WebFault as e:
        raise api_exception(e.message)