Exemple #1
0
def build_delete_request(
        guid,  # type: str
        **kwargs  # type: Any
):
    # type: (...) -> HttpRequest
    """Delete a relationship between entities by its GUID.

    See https://aka.ms/azsdk/python/protocol/quickstart for how to incorporate this request builder into your code flow.

    :param guid: The globally unique identifier of the relationship.
    :type guid: str
    :return: Returns an :class:`~azure.purview.catalog.core.rest.HttpRequest` that you will pass to the client's `send_request` method.
     See https://aka.ms/azsdk/python/protocol/quickstart for how to incorporate this response into your code flow.
    :rtype: ~azure.purview.catalog.core.rest.HttpRequest
    """

    # Construct URL
    url = kwargs.pop("template_url", '/atlas/v2/relationship/guid/{guid}')
    path_format_arguments = {
        'guid':
        _SERIALIZER.url("guid", guid, 'str', max_length=4096, min_length=1),
    }
    url = _format_url_section(url, **path_format_arguments)

    return HttpRequest(method="DELETE", url=url, **kwargs)
Exemple #2
0
def build_get_request(
        guid,  # type: str
        **kwargs  # type: Any
):
    # type: (...) -> HttpRequest
    """Get relationship information between entities by its GUID.

    See https://aka.ms/azsdk/python/protocol/quickstart for how to incorporate this request builder into your code flow.

    :param guid: The globally unique identifier of the relationship.
    :type guid: str
    :keyword extended_info: Limits whether includes extended information.
    :paramtype extended_info: bool
    :return: Returns an :class:`~azure.purview.catalog.core.rest.HttpRequest` that you will pass to the client's `send_request` method.
     See https://aka.ms/azsdk/python/protocol/quickstart for how to incorporate this response into your code flow.
    :rtype: ~azure.purview.catalog.core.rest.HttpRequest

    Example:
        .. code-block:: python


            # response body for status code(s): 200
            response_body == {
                "referredEntities": {
                    "str": {
                        "classificationNames": [
                            "str (optional)"
                        ],
                        "classifications": [
                            {
                                "entityGuid": "str (optional)",
                                "entityStatus": "str (optional)",
                                "removePropagationsOnEntityDelete": "bool (optional)",
                                "source": "str (optional)",
                                "sourceDetails": {
                                    "str": "object (optional)"
                                },
                                "validityPeriods": [
                                    {
                                        "endTime": "str (optional)",
                                        "startTime": "str (optional)",
                                        "timeZone": "str (optional)"
                                    }
                                ]
                            }
                        ],
                        "displayText": "str (optional)",
                        "guid": "str (optional)",
                        "meaningNames": [
                            "str (optional)"
                        ],
                        "meanings": [
                            {
                                "confidence": "int (optional)",
                                "createdBy": "str (optional)",
                                "description": "str (optional)",
                                "displayText": "str (optional)",
                                "expression": "str (optional)",
                                "relationGuid": "str (optional)",
                                "source": "str (optional)",
                                "status": "str (optional)",
                                "steward": "str (optional)",
                                "termGuid": "str (optional)"
                            }
                        ],
                        "status": "str (optional)"
                    }
                },
                "relationship": {
                    "createTime": "float (optional)",
                    "createdBy": "str (optional)",
                    "end1": {
                        "guid": "str (optional)",
                        "typeName": "str (optional)",
                        "uniqueAttributes": {
                            "str": "object (optional)"
                        }
                    },
                    "end2": {
                        "guid": "str (optional)",
                        "typeName": "str (optional)",
                        "uniqueAttributes": {
                            "str": "object (optional)"
                        }
                    },
                    "guid": "str (optional)",
                    "homeId": "str (optional)",
                    "label": "str (optional)",
                    "provenanceType": "float (optional)",
                    "status": "str (optional)",
                    "updateTime": "float (optional)",
                    "updatedBy": "str (optional)",
                    "version": "float (optional)"
                }
            }

    """
    extended_info = kwargs.pop('extended_info', None)  # type: Optional[bool]
    accept = "application/json"

    # Construct URL
    url = kwargs.pop("template_url", '/atlas/v2/relationship/guid/{guid}')
    path_format_arguments = {
        'guid':
        _SERIALIZER.url("guid", guid, 'str', max_length=4096, min_length=1),
    }
    url = _format_url_section(url, **path_format_arguments)

    # Construct parameters
    query_parameters = kwargs.pop("params", {})  # type: Dict[str, Any]
    if extended_info is not None:
        query_parameters['extendedInfo'] = _SERIALIZER.query(
            "extended_info", extended_info, 'bool')

    # Construct headers
    header_parameters = kwargs.pop("headers", {})  # type: Dict[str, Any]
    header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')

    return HttpRequest(method="GET",
                       url=url,
                       params=query_parameters,
                       headers=header_parameters,
                       **kwargs)
Exemple #3
0
def build_create_request(
        **kwargs  # type: Any
):
    # type: (...) -> HttpRequest
    """Create a new relationship between entities.

    See https://aka.ms/azsdk/python/protocol/quickstart for how to incorporate this request builder into your code flow.

    :keyword json: The AtlasRelationship object containing the information for the relationship to
     be created.
    :paramtype json: Any
    :keyword content: The AtlasRelationship object containing the information for the relationship
     to be created.
    :paramtype content: Any
    :return: Returns an :class:`~azure.purview.catalog.core.rest.HttpRequest` that you will pass to the client's `send_request` method.
     See https://aka.ms/azsdk/python/protocol/quickstart for how to incorporate this response into your code flow.
    :rtype: ~azure.purview.catalog.core.rest.HttpRequest

    Example:
        .. code-block:: python


            # JSON input template you can fill out and use as your `json` input.
            json = {
                "createTime": "float (optional)",
                "createdBy": "str (optional)",
                "end1": {
                    "guid": "str (optional)",
                    "typeName": "str (optional)",
                    "uniqueAttributes": {
                        "str": "object (optional)"
                    }
                },
                "end2": {
                    "guid": "str (optional)",
                    "typeName": "str (optional)",
                    "uniqueAttributes": {
                        "str": "object (optional)"
                    }
                },
                "guid": "str (optional)",
                "homeId": "str (optional)",
                "label": "str (optional)",
                "provenanceType": "float (optional)",
                "status": "str (optional)",
                "updateTime": "float (optional)",
                "updatedBy": "str (optional)",
                "version": "float (optional)"
            }


            # response body for status code(s): 200
            response_body == {
                "createTime": "float (optional)",
                "createdBy": "str (optional)",
                "end1": {
                    "guid": "str (optional)",
                    "typeName": "str (optional)",
                    "uniqueAttributes": {
                        "str": "object (optional)"
                    }
                },
                "end2": {
                    "guid": "str (optional)",
                    "typeName": "str (optional)",
                    "uniqueAttributes": {
                        "str": "object (optional)"
                    }
                },
                "guid": "str (optional)",
                "homeId": "str (optional)",
                "label": "str (optional)",
                "provenanceType": "float (optional)",
                "status": "str (optional)",
                "updateTime": "float (optional)",
                "updatedBy": "str (optional)",
                "version": "float (optional)"
            }

    """
    content_type = kwargs.pop("content_type", None)
    accept = "application/json"

    # Construct URL
    url = kwargs.pop("template_url", '/atlas/v2/relationship')

    # Construct headers
    header_parameters = kwargs.pop("headers", {})  # type: Dict[str, Any]
    if content_type is not None:
        header_parameters['Content-Type'] = _SERIALIZER.header(
            "content_type", content_type, 'str')
    header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')

    return HttpRequest(method="POST",
                       url=url,
                       headers=header_parameters,
                       **kwargs)
def build_get_lineage_graph_request(
        guid,  # type: str
        **kwargs  # type: Any
):
    # type: (...) -> HttpRequest
    """Get lineage info of the entity specified by GUID.

    See https://aka.ms/azsdk/python/protocol/quickstart for how to incorporate this request builder into your code flow.

    :param guid: The globally unique identifier of the entity.
    :type guid: str
    :keyword direction: The direction of the lineage, which could be INPUT, OUTPUT or BOTH.
    :paramtype direction: str or ~azure.purview.catalog.models.Direction
    :keyword depth: The number of hops for lineage.
    :paramtype depth: int
    :keyword width: The number of max expanding width in lineage.
    :paramtype width: int
    :keyword include_parent: True to include the parent chain in the response.
    :paramtype include_parent: bool
    :keyword get_derived_lineage: True to include derived lineage in the response.
    :paramtype get_derived_lineage: bool
    :return: Returns an :class:`~azure.purview.catalog.core.rest.HttpRequest` that you will pass to the client's `send_request` method.
     See https://aka.ms/azsdk/python/protocol/quickstart for how to incorporate this response into your code flow.
    :rtype: ~azure.purview.catalog.core.rest.HttpRequest

    Example:
        .. code-block:: python


            # response body for status code(s): 200
            response_body == {
                "baseEntityGuid": "str (optional)",
                "childrenCount": "int (optional)",
                "guidEntityMap": {
                    "str": {
                        "classificationNames": [
                            "str (optional)"
                        ],
                        "classifications": [
                            {
                                "entityGuid": "str (optional)",
                                "entityStatus": "str (optional)",
                                "removePropagationsOnEntityDelete": "bool (optional)",
                                "source": "str (optional)",
                                "sourceDetails": {
                                    "str": "object (optional)"
                                },
                                "validityPeriods": [
                                    {
                                        "endTime": "str (optional)",
                                        "startTime": "str (optional)",
                                        "timeZone": "str (optional)"
                                    }
                                ]
                            }
                        ],
                        "displayText": "str (optional)",
                        "guid": "str (optional)",
                        "meaningNames": [
                            "str (optional)"
                        ],
                        "meanings": [
                            {
                                "confidence": "int (optional)",
                                "createdBy": "str (optional)",
                                "description": "str (optional)",
                                "displayText": "str (optional)",
                                "expression": "str (optional)",
                                "relationGuid": "str (optional)",
                                "source": "str (optional)",
                                "status": "str (optional)",
                                "steward": "str (optional)",
                                "termGuid": "str (optional)"
                            }
                        ],
                        "status": "str (optional)"
                    }
                },
                "includeParent": "bool (optional)",
                "lineageDepth": "int (optional)",
                "lineageDirection": "str (optional)",
                "lineageWidth": "int (optional)",
                "parentRelations": [
                    {
                        "childEntityId": "str (optional)",
                        "parentEntityId": "str (optional)",
                        "relationshipId": "str (optional)"
                    }
                ],
                "relations": [
                    {
                        "fromEntityId": "str (optional)",
                        "relationshipId": "str (optional)",
                        "toEntityId": "str (optional)"
                    }
                ],
                "widthCounts": {
                    "str": {
                        "str": "object (optional)"
                    }
                }
            }

    """
    direction = kwargs.pop(
        'direction')  # type: Union[str, "_models.Direction"]
    depth = kwargs.pop('depth', 3)  # type: Optional[int]
    width = kwargs.pop('width', 10)  # type: Optional[int]
    include_parent = kwargs.pop('include_parent', None)  # type: Optional[bool]
    get_derived_lineage = kwargs.pop('get_derived_lineage',
                                     None)  # type: Optional[bool]
    accept = "application/json"

    # Construct URL
    url = kwargs.pop("template_url", '/atlas/v2/lineage/{guid}')
    path_format_arguments = {
        'guid':
        _SERIALIZER.url("guid", guid, 'str', max_length=4096, min_length=1),
    }
    url = _format_url_section(url, **path_format_arguments)

    # Construct parameters
    query_parameters = kwargs.pop("params", {})  # type: Dict[str, Any]
    if depth is not None:
        query_parameters['depth'] = _SERIALIZER.query("depth", depth, 'int')
    if width is not None:
        query_parameters['width'] = _SERIALIZER.query("width", width, 'int')
    query_parameters['direction'] = _SERIALIZER.query("direction", direction,
                                                      'str')
    if include_parent is not None:
        query_parameters['includeParent'] = _SERIALIZER.query(
            "include_parent", include_parent, 'bool')
    if get_derived_lineage is not None:
        query_parameters['getDerivedLineage'] = _SERIALIZER.query(
            "get_derived_lineage", get_derived_lineage, 'bool')

    # Construct headers
    header_parameters = kwargs.pop("headers", {})  # type: Dict[str, Any]
    header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')

    return HttpRequest(method="GET",
                       url=url,
                       params=query_parameters,
                       headers=header_parameters,
                       **kwargs)
def build_next_page_lineage_request(
        guid,  # type: str
        **kwargs  # type: Any
):
    # type: (...) -> HttpRequest
    """Return immediate next page lineage info about entity with pagination.

    See https://aka.ms/azsdk/python/protocol/quickstart for how to incorporate this request builder into your code flow.

    :param guid: The globally unique identifier of the entity.
    :type guid: str
    :keyword direction: The direction of the lineage, which could be INPUT, OUTPUT or BOTH.
    :paramtype direction: str or ~azure.purview.catalog.models.Direction
    :keyword get_derived_lineage: True to include derived lineage in the response.
    :paramtype get_derived_lineage: bool
    :keyword offset: The offset for pagination purpose.
    :paramtype offset: int
    :keyword limit: The page size - by default there is no paging.
    :paramtype limit: int
    :return: Returns an :class:`~azure.purview.catalog.core.rest.HttpRequest` that you will pass to the client's `send_request` method.
     See https://aka.ms/azsdk/python/protocol/quickstart for how to incorporate this response into your code flow.
    :rtype: ~azure.purview.catalog.core.rest.HttpRequest

    Example:
        .. code-block:: python


            # response body for status code(s): 200
            response_body == {
                "baseEntityGuid": "str (optional)",
                "childrenCount": "int (optional)",
                "guidEntityMap": {
                    "str": {
                        "classificationNames": [
                            "str (optional)"
                        ],
                        "classifications": [
                            {
                                "entityGuid": "str (optional)",
                                "entityStatus": "str (optional)",
                                "removePropagationsOnEntityDelete": "bool (optional)",
                                "source": "str (optional)",
                                "sourceDetails": {
                                    "str": "object (optional)"
                                },
                                "validityPeriods": [
                                    {
                                        "endTime": "str (optional)",
                                        "startTime": "str (optional)",
                                        "timeZone": "str (optional)"
                                    }
                                ]
                            }
                        ],
                        "displayText": "str (optional)",
                        "guid": "str (optional)",
                        "meaningNames": [
                            "str (optional)"
                        ],
                        "meanings": [
                            {
                                "confidence": "int (optional)",
                                "createdBy": "str (optional)",
                                "description": "str (optional)",
                                "displayText": "str (optional)",
                                "expression": "str (optional)",
                                "relationGuid": "str (optional)",
                                "source": "str (optional)",
                                "status": "str (optional)",
                                "steward": "str (optional)",
                                "termGuid": "str (optional)"
                            }
                        ],
                        "status": "str (optional)"
                    }
                },
                "includeParent": "bool (optional)",
                "lineageDepth": "int (optional)",
                "lineageDirection": "str (optional)",
                "lineageWidth": "int (optional)",
                "parentRelations": [
                    {
                        "childEntityId": "str (optional)",
                        "parentEntityId": "str (optional)",
                        "relationshipId": "str (optional)"
                    }
                ],
                "relations": [
                    {
                        "fromEntityId": "str (optional)",
                        "relationshipId": "str (optional)",
                        "toEntityId": "str (optional)"
                    }
                ],
                "widthCounts": {
                    "str": {
                        "str": "object (optional)"
                    }
                }
            }

    """
    direction = kwargs.pop(
        'direction')  # type: Union[str, "_models.Direction"]
    get_derived_lineage = kwargs.pop('get_derived_lineage',
                                     None)  # type: Optional[bool]
    offset = kwargs.pop('offset', None)  # type: Optional[int]
    limit = kwargs.pop('limit', None)  # type: Optional[int]
    api_version = "2021-05-01-preview"
    accept = "application/json"

    # Construct URL
    url = kwargs.pop("template_url", '/lineage/{guid}/next/')
    path_format_arguments = {
        'guid':
        _SERIALIZER.url("guid", guid, 'str', max_length=4096, min_length=1),
    }
    url = _format_url_section(url, **path_format_arguments)

    # Construct parameters
    query_parameters = kwargs.pop("params", {})  # type: Dict[str, Any]
    query_parameters['direction'] = _SERIALIZER.query("direction", direction,
                                                      'str')
    if get_derived_lineage is not None:
        query_parameters['getDerivedLineage'] = _SERIALIZER.query(
            "get_derived_lineage", get_derived_lineage, 'bool')
    if offset is not None:
        query_parameters['offset'] = _SERIALIZER.query("offset", offset, 'int')
    if limit is not None:
        query_parameters['limit'] = _SERIALIZER.query("limit", limit, 'int')
    query_parameters['api-version'] = _SERIALIZER.query(
        "api_version", api_version, 'str')

    # Construct headers
    header_parameters = kwargs.pop("headers", {})  # type: Dict[str, Any]
    header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')

    return HttpRequest(method="GET",
                       url=url,
                       params=query_parameters,
                       headers=header_parameters,
                       **kwargs)
Exemple #6
0
def build_auto_complete_request(*,
                                json: Any = None,
                                content: Any = None,
                                **kwargs: Any) -> HttpRequest:
    """Get auto complete options.

    See https://aka.ms/azsdk/python/protocol/quickstart for how to incorporate this request builder into your code flow.

    :keyword json: An object specifying the autocomplete criteria.
    :paramtype json: Any
    :keyword content: An object specifying the autocomplete criteria.
    :paramtype content: Any
    :return: Returns an :class:`~azure.purview.catalog.core.rest.HttpRequest` that you will pass to the client's `send_request` method.
     See https://aka.ms/azsdk/python/protocol/quickstart for how to incorporate this response into your code flow.
    :rtype: ~azure.purview.catalog.core.rest.HttpRequest

    Example:
        .. code-block:: python


            # JSON input template you can fill out and use as your `json` input.
            json = {
                "filter": "object (optional)",
                "keywords": "str (optional)",
                "limit": "int (optional)"
            }


            # response body for status code(s): 200
            response_body == {
                "value": [
                    {
                        "queryPlusText": "str (optional)",
                        "text": "str (optional)"
                    }
                ]
            }

    """
    content_type = kwargs.pop("content_type", None)
    api_version = "2021-05-01-preview"
    accept = "application/json"

    # Construct URL
    url = kwargs.pop("template_url", '/search/autocomplete')

    # Construct parameters
    query_parameters = kwargs.pop("params", {})  # type: Dict[str, Any]
    query_parameters['api-version'] = _SERIALIZER.query(
        "api_version", api_version, 'str')

    # Construct headers
    header_parameters = kwargs.pop("headers", {})  # type: Dict[str, Any]
    if content_type is not None:
        header_parameters['Content-Type'] = _SERIALIZER.header(
            "content_type", content_type, 'str')
    header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')

    return HttpRequest(method="POST",
                       url=url,
                       params=query_parameters,
                       headers=header_parameters,
                       json=json,
                       content=content,
                       **kwargs)
Exemple #7
0
def build_query_request(*,
                        json: Any = None,
                        content: Any = None,
                        **kwargs: Any) -> HttpRequest:
    """Gets data using search.

    See https://aka.ms/azsdk/python/protocol/quickstart for how to incorporate this request builder into your code flow.

    :keyword json: An object specifying the search criteria.
    :paramtype json: Any
    :keyword content: An object specifying the search criteria.
    :paramtype content: Any
    :return: Returns an :class:`~azure.purview.catalog.core.rest.HttpRequest` that you will pass to the client's `send_request` method.
     See https://aka.ms/azsdk/python/protocol/quickstart for how to incorporate this response into your code flow.
    :rtype: ~azure.purview.catalog.core.rest.HttpRequest

    Example:
        .. code-block:: python


            # JSON input template you can fill out and use as your `json` input.
            json = {
                "facets": [
                    {
                        "count": "int (optional)",
                        "facet": "str (optional)",
                        "sort": "object (optional)"
                    }
                ],
                "filter": "object (optional)",
                "keywords": "str (optional)",
                "limit": "int (optional)",
                "offset": "int (optional)",
                "taxonomySetting": {
                    "assetTypes": [
                        "str (optional)"
                    ],
                    "facet": {
                        "count": "int (optional)",
                        "facet": "str (optional)",
                        "sort": "object (optional)"
                    }
                }
            }


            # response body for status code(s): 200
            response_body == {
                "@search.count": "int (optional)",
                "@search.facets": {
                    "assetType": [
                        {
                            "count": "int (optional)",
                            "value": "str (optional)"
                        }
                    ],
                    "classification": [
                        {
                            "count": "int (optional)",
                            "value": "str (optional)"
                        }
                    ],
                    "classificationCategory": [
                        {
                            "count": "int (optional)",
                            "value": "str (optional)"
                        }
                    ],
                    "contactId": [
                        {
                            "count": "int (optional)",
                            "value": "str (optional)"
                        }
                    ],
                    "fileExtension": [
                        {
                            "count": "int (optional)",
                            "value": "str (optional)"
                        }
                    ],
                    "label": [
                        {
                            "count": "int (optional)",
                            "value": "str (optional)"
                        }
                    ],
                    "term": [
                        {
                            "count": "int (optional)",
                            "value": "str (optional)"
                        }
                    ]
                },
                "value": [
                    {
                        "@search.highlights": {
                            "description": [
                                "str (optional)"
                            ],
                            "entityType": [
                                "str (optional)"
                            ],
                            "id": [
                                "str (optional)"
                            ],
                            "name": [
                                "str (optional)"
                            ],
                            "qualifiedName": [
                                "str (optional)"
                            ]
                        },
                        "@search.score": "float (optional)",
                        "@search.text": "str (optional)",
                        "assetType": [
                            "str (optional)"
                        ],
                        "classification": [
                            "str (optional)"
                        ],
                        "contact": [
                            {
                                "contactType": "str (optional)",
                                "id": "str (optional)",
                                "info": "str (optional)"
                            }
                        ],
                        "description": "str (optional)",
                        "entityType": "str (optional)",
                        "id": "str (optional)",
                        "label": [
                            "str (optional)"
                        ],
                        "name": "str (optional)",
                        "owner": "str (optional)",
                        "qualifiedName": "str (optional)",
                        "term": [
                            {
                                "glossaryName": "str (optional)",
                                "guid": "str (optional)",
                                "name": "str (optional)"
                            }
                        ]
                    }
                ]
            }

    """
    content_type = kwargs.pop("content_type", None)
    api_version = "2021-05-01-preview"
    accept = "application/json"

    # Construct URL
    url = kwargs.pop("template_url", '/search/query')

    # Construct parameters
    query_parameters = kwargs.pop("params", {})  # type: Dict[str, Any]
    query_parameters['api-version'] = _SERIALIZER.query(
        "api_version", api_version, 'str')

    # Construct headers
    header_parameters = kwargs.pop("headers", {})  # type: Dict[str, Any]
    if content_type is not None:
        header_parameters['Content-Type'] = _SERIALIZER.header(
            "content_type", content_type, 'str')
    header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')

    return HttpRequest(method="POST",
                       url=url,
                       params=query_parameters,
                       headers=header_parameters,
                       json=json,
                       content=content,
                       **kwargs)