def list_topostore_relation()

in aliyun/log/logclient.py [0:0]


    def list_topostore_relation(self, topostore_name, relation_ids=None, relation_types=None,
            src_node_ids=None, dst_node_ids=None,
            property_key=None, property_value=None, offset=0, size=100):
        """list Topostore relationss
        Unsuccessful operation will cause an LogException.

        :type topostore_name: string
        :param topostore_name: topostore name

        :type relation_ids: list of string
        :param relation_ids: topostore relation ids (which is str)

        :type relation_types: list of string
        :param relation_types: list of relation id (which is str)

        :type src_node_ids: list of string
        :param src_node_ids: list of src_node_id (which is str)

        :type dst_node_ids: list of string
        :param dst_node_ids: list of dst_node_id (which is str)

        :type property_key: string
        :param property_key: property_key of relation id property

        :type property_value: string
        :param property_value: property_value of relation id property

        :type offset: long int
        :param offset: start location

        :type size: long int
        :param size: max relations for each page

        """
        if not isinstance(topostore_name, str):
            raise TypeError("resource_name type must be str")

        if relation_ids and not isinstance(relation_ids, list):
            raise TypeError("relation_ids type must be list,element is relation id which type is str")

        if relation_types and not isinstance(relation_types, list):
            raise TypeError("relation_types must be list of string")

        if relation_types and isinstance(relation_types, list):
            for relation_type in relation_types:
                if not isinstance(relation_type, str):
                    raise TypeError("relation_types must be list of string")

        if src_node_ids and not isinstance(src_node_ids, list):
            raise TypeError("src_node_ids must be list of string")
        if src_node_ids and isinstance(src_node_ids, list):
            for src_node_id in src_node_ids:
                if not isinstance(src_node_id, str):
                    raise TypeError("src_node_ids must be list of string")

        if dst_node_ids and not isinstance(dst_node_ids, list):
            raise TypeError("dst_node_id must be str")
        if dst_node_ids and isinstance(dst_node_ids, list):
            for dst_node_id in dst_node_ids:
                if not isinstance(dst_node_id, str):
                    raise TypeError("dst_node_ids must be list of string")

        if property_key and not isinstance(property_key, str):
            raise TypeError("property_key must be str")

        if property_value and not isinstance(property_value, str):
            raise TypeError("property_value must be str")

        if not (isinstance(size, int) and isinstance(offset, int)):
            raise TypeError("size and offset type must be int")

        headers = {}
        params = {"offset": offset, "size": size}
        if relation_ids is not None:
            params["relationIds"] = ','.join(relation_ids)

        if relation_types is not None:
            params["relationTypes"] = ",".join(relation_types)

        if src_node_ids is not None:
            params["srcNodeIds"] = ",".join(src_node_ids)

        if dst_node_ids is not None:
            params["dstNodeIds"] = ",".join(dst_node_ids)

        if property_key is not None:
            params["propertyKey"] = property_key

        if property_value is not None:
            params["propertyValue"] = property_value

        resource = "/topostores/" + topostore_name + "/relations"
        (resp, header) = self._send("GET", None, None, resource, params, headers)
        return ListTopostoreRelationsResponse(resp, header)