コード例 #1
0
def build_create_or_update_collection_request(
        collection_name,  # type: str
        **kwargs  # type: Any
):
    # type: (...) -> HttpRequest
    content_type = kwargs.pop('content_type', None)  # type: Optional[str]

    api_version = "2019-11-01-preview"
    accept = "application/json"
    # Construct URL
    url = kwargs.pop("template_url", '/collections/{collectionName}')
    path_format_arguments = {
        "collectionName":
        _SERIALIZER.url("collection_name", collection_name, 'str'),
    }

    url = _format_url_section(url, **path_format_arguments)

    # 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="PUT",
                       url=url,
                       params=query_parameters,
                       headers=header_parameters,
                       **kwargs)
コード例 #2
0
def build_query_id_by_content_request(group_name: str, schema_name: str, *,
                                      content: Any, serialization_type: str,
                                      **kwargs: Any) -> HttpRequest:
    """Get ID for existing schema.

    Gets the ID referencing an existing schema within the specified schema group, as matched by
    schema content comparison.

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

    :param group_name: Schema group under which schema is registered.  Group's serialization type
     should match the serialization type specified in the request.
    :type group_name: str
    :param schema_name: Name of the registered schema.
    :type schema_name: str
    :keyword content: Pass in binary content you want in the body of the request (typically bytes,
     a byte iterator, or stream input). String representation (UTF-8) of the registered schema.
    :paramtype content: any
    :keyword serialization_type: Serialization type for the schema being registered. "avro"
    :paramtype serialization_type: str
    :return: Returns an :class:`~azure.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.core.rest.HttpRequest
    """

    content_type = kwargs.pop('content_type', None)  # type: Optional[str]

    api_version = "2020-09-01-preview"
    accept = "application/json"
    # Construct URL
    url = kwargs.pop("template_url",
                     '/$schemagroups/{group-name}/schemas/{schema-name}')
    path_format_arguments = {
        'group-name': _SERIALIZER.url("group_name", group_name, 'str'),
        'schema-name': _SERIALIZER.url("schema_name", schema_name, 'str'),
    }
    url = _format_url_section(url, **path_format_arguments)

    # 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]
    header_parameters['Serialization-Type'] = _SERIALIZER.header(
        "serialization_type", serialization_type, 'str')
    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,
                       content=content,
                       **kwargs)
コード例 #3
0
def build_get_collection_path_request(
        collection_name,  # type: str
        **kwargs  # type: Any
):
    # type: (...) -> HttpRequest
    api_version = "2019-11-01-preview"
    accept = "application/json"
    # Construct URL
    url = kwargs.pop("template_url",
                     '/collections/{collectionName}/getCollectionPath')
    path_format_arguments = {
        "collectionName":
        _SERIALIZER.url("collection_name", collection_name, 'str'),
    }

    url = _format_url_section(url, **path_format_arguments)

    # 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]
    header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')

    return HttpRequest(method="GET",
                       url=url,
                       params=query_parameters,
                       headers=header_parameters,
                       **kwargs)
コード例 #4
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)
コード例 #5
0
def build_list_versions_by_classification_rule_name_request(
        classification_rule_name,  # type: str
        **kwargs  # type: Any
):
    # type: (...) -> HttpRequest
    """Lists the rule versions of a classification rule.

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

    :param classification_rule_name:
    :type classification_rule_name: str
    :return: Returns an :class:`~azure.purview.scanning.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.scanning.core.rest.HttpRequest

    Example:
        .. code-block:: python


            # response body for status code(s): 200
            response_body == {
                "count": "long (optional)",
                "nextLink": "str (optional)",
                "value": [
                    {
                        "kind": "ClassificationRule"
                    }
                ]
            }

    """
    api_version = "2018-12-01-preview"
    accept = "application/json"

    # Construct URL
    url = kwargs.pop("template_url",
                     '/classificationrules/{classificationRuleName}/versions')
    path_format_arguments = {
        'classificationRuleName':
        _SERIALIZER.url("classification_rule_name", classification_rule_name,
                        'str'),
    }
    url = _format_url_section(url, **path_format_arguments)

    # 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]
    header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')

    return HttpRequest(method="GET",
                       url=url,
                       params=query_parameters,
                       headers=header_parameters,
                       **kwargs)
コード例 #6
0
def build_get_by_version_request(
        version,  # type: int
        **kwargs  # type: Any
):
    # type: (...) -> HttpRequest
    """Get a scan ruleset by version.

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

    :param version:
    :type version: int
    :keyword data_source_type:
    :paramtype data_source_type: str or ~azure.purview.scanning.models.DataSourceType
    :return: Returns an :class:`~azure.purview.scanning.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.scanning.core.rest.HttpRequest

    Example:
        .. code-block:: python


            # response body for status code(s): 200
            response_body == {
                "kind": "SystemScanRuleset"
            }

    """
    data_source_type = kwargs.pop(
        'data_source_type',
        None)  # type: Optional[Union[str, "_models.DataSourceType"]]
    api_version = "2018-12-01-preview"
    accept = "application/json"

    # Construct URL
    url = kwargs.pop("template_url", '/systemScanRulesets/versions/{version}')
    path_format_arguments = {
        'version': _SERIALIZER.url("version", version, 'int'),
    }
    url = _format_url_section(url, **path_format_arguments)

    # Construct parameters
    query_parameters = kwargs.pop("params", {})  # type: Dict[str, Any]
    if data_source_type is not None:
        query_parameters['dataSourceType'] = _SERIALIZER.query(
            "data_source_type", data_source_type, 'str')
    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)
コード例 #7
0
def build_get_trigger_request(
        data_source_name,  # type: str
        scan_name,  # type: str
        **kwargs  # type: Any
):
    # type: (...) -> HttpRequest
    """Gets trigger information.

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

    :param data_source_name:
    :type data_source_name: str
    :param scan_name:
    :type scan_name: str
    :return: Returns an :class:`~azure.purview.scanning.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.scanning.core.rest.HttpRequest

    Example:
        .. code-block:: python


            # response body for status code(s): 200
            response_body == {
                "properties": {}
            }

    """
    api_version = "2018-12-01-preview"
    accept = "application/json"

    # Construct URL
    url = kwargs.pop(
        "template_url",
        '/datasources/{dataSourceName}/scans/{scanName}/triggers/default')
    path_format_arguments = {
        'dataSourceName':
        _SERIALIZER.url("data_source_name", data_source_name, 'str'),
        'scanName':
        _SERIALIZER.url("scan_name", scan_name, 'str'),
    }
    url = _format_url_section(url, **path_format_arguments)

    # 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]
    header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')

    return HttpRequest(method="GET",
                       url=url,
                       params=query_parameters,
                       headers=header_parameters,
                       **kwargs)
コード例 #8
0
def build_remove_connection_from_group_request(
        hub,  # type: str
        group,  # type: str
        connection_id,  # type: str
        **kwargs  # type: Any
):
    # type: (...) -> HttpRequest
    """Remove a connection from the target group.

    Remove a connection from the target group.

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

    :param hub: Target hub name, which should start with alphabetic characters and only contain
     alpha-numeric characters or underscore.
    :type hub: str
    :param group: Target group name, which length should be greater than 0 and less than 1025.
    :type group: str
    :param connection_id: Target connection Id.
    :type connection_id: str
    :keyword api_version: Api Version.
    :paramtype api_version: str
    :return: Returns an :class:`~azure.messaging.webpubsubservice.core.rest.HttpRequest` that you will pass to the client's `send_request` method.
     See https://aka.ms/azsdk/python/llcwiki for how to incorporate this response into your code flow.
    :rtype: ~azure.messaging.webpubsubservice.core.rest.HttpRequest
    """
    api_version = kwargs.pop('api_version',
                             "2021-05-01-preview")  # type: Optional[str]

    # Construct URL
    url = kwargs.pop(
        "template_url",
        '/api/hubs/{hub}/groups/{group}/connections/{connectionId}')
    path_format_arguments = {
        'hub':
        _SERIALIZER.url("hub",
                        hub,
                        'str',
                        pattern=r'^[A-Za-z][A-Za-z0-9_`,.[\]]{0,127}$'),
        'group':
        _SERIALIZER.url("group", group, 'str', max_length=1024, min_length=1),
        'connectionId':
        _SERIALIZER.url("connection_id", connection_id, 'str', min_length=1),
    }
    url = _format_url_section(url, **path_format_arguments)

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

    return HttpRequest(method="DELETE",
                       url=url,
                       params=query_parameters,
                       **kwargs)
コード例 #9
0
def build_delete_request(
    scan_ruleset_name,  # type: str
    **kwargs  # type: Any
):
    # type: (...) -> HttpRequest
    """Deletes a scan ruleset.

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

    :param scan_ruleset_name:
    :type scan_ruleset_name: str
    :return: Returns an :class:`~azure.purview.scanning.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.scanning.core.rest.HttpRequest

    Example:
        .. code-block:: python


            # response body for status code(s): 200
            response_body == {
                "kind": "ScanRuleset"
            }

    """
    api_version = "2018-12-01-preview"
    accept = "application/json"

    # Construct URL
    url = kwargs.pop("template_url", '/scanrulesets/{scanRulesetName}')
    path_format_arguments = {
        'scanRulesetName': _SERIALIZER.url("scan_ruleset_name", scan_ruleset_name, 'str'),
    }
    url = _format_url_section(url, **path_format_arguments)

    # 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]
    header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')

    return HttpRequest(
        method="DELETE",
        url=url,
        params=query_parameters,
        headers=header_parameters,
        **kwargs
    )
コード例 #10
0
def build_user_exists_request(
        hub,  # type: str
        user_id,  # type: str
        **kwargs  # type: Any
):
    # type: (...) -> HttpRequest
    """Check if there are any client connections connected for the given user.

    Check if there are any client connections connected for the given user.

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

    :param hub: Target hub name, which should start with alphabetic characters and only contain
     alpha-numeric characters or underscore.
    :type hub: str
    :param user_id: Target user Id.
    :type user_id: str
    :keyword api_version: Api Version.
    :paramtype api_version: str
    :return: Returns an :class:`~azure.messaging.webpubsubservice.core.rest.HttpRequest` that you will pass to the client's `send_request` method.
     See https://aka.ms/azsdk/python/llcwiki for how to incorporate this response into your code flow.
    :rtype: ~azure.messaging.webpubsubservice.core.rest.HttpRequest
    """
    api_version = kwargs.pop('api_version',
                             "2021-05-01-preview")  # type: Optional[str]

    # Construct URL
    url = kwargs.pop("template_url", '/api/hubs/{hub}/users/{userId}')
    path_format_arguments = {
        'hub':
        _SERIALIZER.url("hub",
                        hub,
                        'str',
                        pattern=r'^[A-Za-z][A-Za-z0-9_`,.[\]]{0,127}$'),
        'userId':
        _SERIALIZER.url("user_id", user_id, 'str', min_length=1),
    }
    url = _format_url_section(url, **path_format_arguments)

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

    return HttpRequest(method="HEAD",
                       url=url,
                       params=query_parameters,
                       **kwargs)
コード例 #11
0
def build_get_by_id_request(
        schema_id,  # type: str
        **kwargs  # type: Any
):
    # type: (...) -> HttpRequest
    """Get a registered schema by its unique ID reference.

    Gets a registered schema by its unique ID.  Azure Schema Registry guarantees that ID is unique
    within a namespace.

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

    :param schema_id: References specific schema in registry namespace.
    :type schema_id: str
    :return: Returns an :class:`~azure.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.core.rest.HttpRequest
    """

    api_version = "2020-09-01-preview"
    accept = "text/plain; charset=utf-8"
    # Construct URL
    url = kwargs.pop("template_url",
                     '/$schemagroups/getSchemaById/{schema-id}')
    path_format_arguments = {
        'schema-id': _SERIALIZER.url("schema_id", schema_id, 'str'),
    }
    url = _format_url_section(url, **path_format_arguments)

    # 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]
    header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')

    return HttpRequest(method="GET",
                       url=url,
                       params=query_parameters,
                       headers=header_parameters,
                       **kwargs)
コード例 #12
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)
コード例 #13
0
def build_send_to_all_request(
        hub,  # type: str
        **kwargs  # type: Any
):
    # type: (...) -> HttpRequest
    """Broadcast content inside request body to all the connected client connections.

    Broadcast content inside request body to all the connected client connections.

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

    :param hub: Target hub name, which should start with alphabetic characters and only contain
     alpha-numeric characters or underscore.
    :type hub: str
    :keyword json: The payload body.
    :paramtype json: Any
    :keyword content: The payload body.
    :paramtype content: IO
    :keyword excluded: Excluded connection Ids.
    :paramtype excluded: list[str]
    :keyword api_version: Api Version.
    :paramtype api_version: str
    :return: Returns an :class:`~azure.messaging.webpubsubservice.core.rest.HttpRequest` that you will pass to the client's `send_request` method.
     See https://aka.ms/azsdk/python/llcwiki for how to incorporate this response into your code flow.
    :rtype: ~azure.messaging.webpubsubservice.core.rest.HttpRequest

    Example:
        .. code-block:: python

            # JSON input template you can fill out and use as your `json` input.
            json = "Any (optional)"
    """
    excluded = kwargs.pop('excluded', None)  # type: Optional[List[str]]
    api_version = kwargs.pop('api_version',
                             "2021-05-01-preview")  # type: Optional[str]
    content_type = kwargs.pop("content_type", None)

    # Construct URL
    url = kwargs.pop("template_url", '/api/hubs/{hub}/:send')
    path_format_arguments = {
        'hub':
        _SERIALIZER.url("hub",
                        hub,
                        'str',
                        pattern=r'^[A-Za-z][A-Za-z0-9_`,.[\]]{0,127}$'),
    }
    url = _format_url_section(url, **path_format_arguments)

    # Construct parameters
    query_parameters = kwargs.pop("params", {})  # type: Dict[str, Any]
    if excluded is not None:
        query_parameters['excluded'] = [
            _SERIALIZER.query("excluded", q, 'str') if q is not None else ''
            for q in excluded
        ]
    if api_version is not None:
        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')

    return HttpRequest(method="POST",
                       url=url,
                       params=query_parameters,
                       headers=header_parameters,
                       **kwargs)
コード例 #14
0
def build_check_permission_request(
        hub,  # type: str
        permission,  # type: Permissions
        connection_id,  # type: str
        **kwargs  # type: Any
):
    # type: (...) -> HttpRequest
    """Check if a connection has permission to the specified action.

    Check if a connection has permission to the specified action.

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

    :param hub: Target hub name, which should start with alphabetic characters and only contain
     alpha-numeric characters or underscore.
    :type hub: str
    :param permission: The permission: current supported actions are joinLeaveGroup and
     sendToGroup.
    :type permission: ~Permissions
    :param connection_id: Target connection Id.
    :type connection_id: str
    :keyword target_name: Optional. If not set, get the permission for all targets. If set, get the
     permission for the specific target. The meaning of the target depends on the specific
     permission.
    :paramtype target_name: str
    :keyword api_version: Api Version.
    :paramtype api_version: str
    :return: Returns an :class:`~azure.messaging.webpubsubservice.core.rest.HttpRequest` that you will pass to the client's `send_request` method.
     See https://aka.ms/azsdk/python/llcwiki for how to incorporate this response into your code flow.
    :rtype: ~azure.messaging.webpubsubservice.core.rest.HttpRequest
    """
    target_name = kwargs.pop('target_name', None)  # type: Optional[str]
    api_version = kwargs.pop('api_version',
                             "2021-05-01-preview")  # type: Optional[str]

    # Construct URL
    url = kwargs.pop(
        "template_url",
        '/api/hubs/{hub}/permissions/{permission}/connections/{connectionId}')
    path_format_arguments = {
        'hub':
        _SERIALIZER.url("hub",
                        hub,
                        'str',
                        pattern=r'^[A-Za-z][A-Za-z0-9_`,.[\]]{0,127}$'),
        'permission':
        _SERIALIZER.url("permission", permission, 'str'),
        'connectionId':
        _SERIALIZER.url("connection_id", connection_id, 'str', min_length=1),
    }
    url = _format_url_section(url, **path_format_arguments)

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

    return HttpRequest(method="HEAD",
                       url=url,
                       params=query_parameters,
                       **kwargs)
コード例 #15
0
def build_create_or_update_request(
    data_source_name,  # type: str
    **kwargs  # type: Any
):
    # type: (...) -> HttpRequest
    """Creates or Updates a data source.

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

    :param data_source_name:
    :type data_source_name: str
    :keyword json:
    :paramtype json: Any
    :keyword content:
    :paramtype content: Any
    :return: Returns an :class:`~azure.purview.scanning.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.scanning.core.rest.HttpRequest

    Example:
        .. code-block:: python


            # kind template as part of your input body
            kind = 'AdlsGen1DataSource' or 'AdlsGen2DataSource' or 'AmazonAccountDataSource' or 'AmazonPostgreSqlDataSource' or 'AmazonS3DataSource' or 'AmazonSqlDataSource' or 'AzureCosmosDbDataSource' or 'AzureDataExplorerDataSource' or 'AzureFileServiceDataSource' or 'AzureMySqlDataSource' or 'AzurePostgreSqlDataSource' or 'AzureResourceGroupDataSource' or 'AzureSqlDataWarehouseDataSource' or 'AzureSqlDatabaseDataSource' or 'AzureSqlDatabaseManagedInstanceDataSource' or 'AzureStorageDataSource' or 'AzureSubscriptionDataSource' or 'AzureSynapseDataSource' or 'AzureSynapseWorkspaceDataSource' or 'OracleDataSource' or 'PowerBIDataSource' or 'SapEccDataSource' or 'SapS4HanaDataSource' or 'SqlServerDatabaseDataSource' or 'TeradataDataSource'

            # JSON input template you can fill out and use as your `json` input.
            json = {
                "kind": "DataSource",
                "scans": [
                    {
                        "kind": "Scan",
                        "scanResults": [
                            {
                                "assetsClassified": "long (optional)",
                                "assetsDiscovered": "long (optional)",
                                "dataSourceType": "str (optional)",
                                "diagnostics": {},
                                "endTime": "datetime (optional)",
                                "error": {},
                                "errorMessage": "str (optional)",
                                "id": "str (optional)",
                                "parentId": "str (optional)",
                                "pipelineStartTime": "datetime (optional)",
                                "queuedTime": "datetime (optional)",
                                "resourceId": "str (optional)",
                                "runType": "str (optional)",
                                "scanLevelType": "str (optional)",
                                "scanRulesetType": "str (optional)",
                                "scanRulesetVersion": "int (optional)",
                                "startTime": "datetime (optional)",
                                "status": "str (optional)"
                            }
                        ]
                    }
                ]
            }


            # response body for status code(s): 200, 201
            response_body == {
                "kind": "DataSource",
                "scans": [
                    {
                        "kind": "Scan",
                        "scanResults": [
                            {
                                "assetsClassified": "long (optional)",
                                "assetsDiscovered": "long (optional)",
                                "dataSourceType": "str (optional)",
                                "diagnostics": {},
                                "endTime": "datetime (optional)",
                                "error": {},
                                "errorMessage": "str (optional)",
                                "id": "str (optional)",
                                "parentId": "str (optional)",
                                "pipelineStartTime": "datetime (optional)",
                                "queuedTime": "datetime (optional)",
                                "resourceId": "str (optional)",
                                "runType": "str (optional)",
                                "scanLevelType": "str (optional)",
                                "scanRulesetType": "str (optional)",
                                "scanRulesetVersion": "int (optional)",
                                "startTime": "datetime (optional)",
                                "status": "str (optional)"
                            }
                        ]
                    }
                ]
            }

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

    # Construct URL
    url = kwargs.pop("template_url", '/datasources/{dataSourceName}')
    path_format_arguments = {
        'dataSourceName': _SERIALIZER.url("data_source_name", data_source_name, 'str'),
    }
    url = _format_url_section(url, **path_format_arguments)

    # 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="PUT",
        url=url,
        params=query_parameters,
        headers=header_parameters,
        **kwargs
    )
コード例 #16
0
def build_list_scan_history_request(
        data_source_name,  # type: str
        scan_name,  # type: str
        **kwargs  # type: Any
):
    # type: (...) -> HttpRequest
    """Lists the scan history of a scan.

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

    :param data_source_name:
    :type data_source_name: str
    :param scan_name:
    :type scan_name: str
    :return: Returns an :class:`~azure.purview.scanning.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.scanning.core.rest.HttpRequest

    Example:
        .. code-block:: python


            # response body for status code(s): 200
            response_body == {
                "count": "long (optional)",
                "nextLink": "str (optional)",
                "value": [
                    {
                        "assetsClassified": "long (optional)",
                        "assetsDiscovered": "long (optional)",
                        "dataSourceType": "str (optional)",
                        "diagnostics": {},
                        "endTime": "datetime (optional)",
                        "error": {},
                        "errorMessage": "str (optional)",
                        "id": "str (optional)",
                        "parentId": "str (optional)",
                        "pipelineStartTime": "datetime (optional)",
                        "queuedTime": "datetime (optional)",
                        "resourceId": "str (optional)",
                        "runType": "str (optional)",
                        "scanLevelType": "str (optional)",
                        "scanRulesetType": "str (optional)",
                        "scanRulesetVersion": "int (optional)",
                        "startTime": "datetime (optional)",
                        "status": "str (optional)"
                    }
                ]
            }

    """
    api_version = "2018-12-01-preview"
    accept = "application/json"

    # Construct URL
    url = kwargs.pop("template_url",
                     '/datasources/{dataSourceName}/scans/{scanName}/runs')
    path_format_arguments = {
        'dataSourceName':
        _SERIALIZER.url("data_source_name", data_source_name, 'str'),
        'scanName':
        _SERIALIZER.url("scan_name", scan_name, 'str'),
    }
    url = _format_url_section(url, **path_format_arguments)

    # 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]
    header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')

    return HttpRequest(method="GET",
                       url=url,
                       params=query_parameters,
                       headers=header_parameters,
                       **kwargs)
コード例 #17
0
def build_tag_classification_version_request(
        classification_rule_name,  # type: str
        classification_rule_version,  # type: int
        **kwargs  # type: Any
):
    # type: (...) -> HttpRequest
    """Sets Classification Action on a specific classification rule version.

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

    :param classification_rule_name:
    :type classification_rule_name: str
    :param classification_rule_version:
    :type classification_rule_version: int
    :keyword action:
    :paramtype action: str or ~azure.purview.scanning.models.ClassificationAction
    :return: Returns an :class:`~azure.purview.scanning.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.scanning.core.rest.HttpRequest

    Example:
        .. code-block:: python


            # response body for status code(s): 202
            response_body == {
                "endTime": "datetime (optional)",
                "error": {},
                "scanResultId": "str (optional)",
                "startTime": "datetime (optional)",
                "status": "str (optional)"
            }

    """
    action = kwargs.pop(
        'action')  # type: Union[str, "_models.ClassificationAction"]
    api_version = "2018-12-01-preview"
    accept = "application/json"

    # Construct URL
    url = kwargs.pop(
        "template_url",
        '/classificationrules/{classificationRuleName}/versions/{classificationRuleVersion}/:tag'
    )
    path_format_arguments = {
        'classificationRuleName':
        _SERIALIZER.url("classification_rule_name", classification_rule_name,
                        'str'),
        'classificationRuleVersion':
        _SERIALIZER.url("classification_rule_version",
                        classification_rule_version, 'int'),
    }
    url = _format_url_section(url, **path_format_arguments)

    # Construct parameters
    query_parameters = kwargs.pop("params", {})  # type: Dict[str, Any]
    query_parameters['action'] = _SERIALIZER.query("action", action, 'str')
    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="POST",
                       url=url,
                       params=query_parameters,
                       headers=header_parameters,
                       **kwargs)
コード例 #18
0
def build_create_or_update_request(
    scan_ruleset_name,  # type: str
    **kwargs  # type: Any
):
    # type: (...) -> HttpRequest
    """Creates or Updates a scan ruleset.

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

    :param scan_ruleset_name:
    :type scan_ruleset_name: str
    :keyword json:
    :paramtype json: Any
    :keyword content:
    :paramtype content: Any
    :return: Returns an :class:`~azure.purview.scanning.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.scanning.core.rest.HttpRequest

    Example:
        .. code-block:: python


            # kind template as part of your input body
            kind = 'AdlsGen1ScanRuleset' or 'AdlsGen2ScanRuleset' or 'AmazonAccountScanRuleset' or 'AmazonPostgreSqlScanRuleset' or 'AmazonS3ScanRuleset' or 'AmazonSqlScanRuleset' or 'AzureCosmosDbScanRuleset' or 'AzureDataExplorerScanRuleset' or 'AzureFileServiceScanRuleset' or 'AzureMySqlScanRuleset' or 'AzurePostgreSqlScanRuleset' or 'AzureResourceGroupScanRuleset' or 'AzureSqlDataWarehouseScanRuleset' or 'AzureSqlDatabaseScanRuleset' or 'AzureSqlDatabaseManagedInstanceScanRuleset' or 'AzureStorageScanRuleset' or 'AzureSubscriptionScanRuleset' or 'AzureSynapseScanRuleset' or 'AzureSynapseWorkspaceScanRuleset' or 'OracleScanRuleset' or 'PowerBIScanRuleset' or 'SapEccScanRuleset' or 'SapS4HanaScanRuleset' or 'SqlServerDatabaseScanRuleset' or 'TeradataScanRuleset'

            # JSON input template you can fill out and use as your `json` input.
            json = {
                "kind": "ScanRuleset"
            }


            # response body for status code(s): 200, 201
            response_body == {
                "kind": "ScanRuleset"
            }

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

    # Construct URL
    url = kwargs.pop("template_url", '/scanrulesets/{scanRulesetName}')
    path_format_arguments = {
        'scanRulesetName': _SERIALIZER.url("scan_ruleset_name", scan_ruleset_name, 'str'),
    }
    url = _format_url_section(url, **path_format_arguments)

    # 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="PUT",
        url=url,
        params=query_parameters,
        headers=header_parameters,
        **kwargs
    )
コード例 #19
0
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)
コード例 #20
0
def build_create_or_update_request(
        classification_rule_name,  # type: str
        **kwargs  # type: Any
):
    # type: (...) -> HttpRequest
    """Creates or Updates a classification rule.

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

    :param classification_rule_name:
    :type classification_rule_name: str
    :keyword json:
    :paramtype json: Any
    :keyword content:
    :paramtype content: Any
    :return: Returns an :class:`~azure.purview.scanning.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.scanning.core.rest.HttpRequest

    Example:
        .. code-block:: python


            # kind template as part of your input body
            kind = 'CustomClassificationRule' or 'SystemClassificationRule'

            # JSON input template you can fill out and use as your `json` input.
            json = {
                "kind": "ClassificationRule"
            }


            # response body for status code(s): 200, 201
            response_body == {
                "kind": "ClassificationRule"
            }

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

    # Construct URL
    url = kwargs.pop("template_url",
                     '/classificationrules/{classificationRuleName}')
    path_format_arguments = {
        'classificationRuleName':
        _SERIALIZER.url("classification_rule_name", classification_rule_name,
                        'str'),
    }
    url = _format_url_section(url, **path_format_arguments)

    # 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="PUT",
                       url=url,
                       params=query_parameters,
                       headers=header_parameters,
                       **kwargs)
コード例 #21
0
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)
コード例 #22
0
def build_run_scan_request(
        data_source_name,  # type: str
        scan_name,  # type: str
        run_id,  # type: str
        **kwargs  # type: Any
):
    # type: (...) -> HttpRequest
    """Runs the scan.

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

    :param data_source_name:
    :type data_source_name: str
    :param scan_name:
    :type scan_name: str
    :param run_id:
    :type run_id: str
    :keyword scan_level:
    :paramtype scan_level: str or ~azure.purview.scanning.models.ScanLevelType
    :return: Returns an :class:`~azure.purview.scanning.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.scanning.core.rest.HttpRequest

    Example:
        .. code-block:: python


            # response body for status code(s): 202
            response_body == {
                "endTime": "datetime (optional)",
                "error": {},
                "scanResultId": "str (optional)",
                "startTime": "datetime (optional)",
                "status": "str (optional)"
            }

    """
    scan_level = kwargs.pop(
        'scan_level',
        None)  # type: Optional[Union[str, "_models.ScanLevelType"]]
    api_version = "2018-12-01-preview"
    accept = "application/json"

    # Construct URL
    url = kwargs.pop(
        "template_url",
        '/datasources/{dataSourceName}/scans/{scanName}/runs/{runId}')
    path_format_arguments = {
        'dataSourceName':
        _SERIALIZER.url("data_source_name", data_source_name, 'str'),
        'scanName':
        _SERIALIZER.url("scan_name", scan_name, 'str'),
        'runId':
        _SERIALIZER.url("run_id", run_id, 'str'),
    }
    url = _format_url_section(url, **path_format_arguments)

    # Construct parameters
    query_parameters = kwargs.pop("params", {})  # type: Dict[str, Any]
    if scan_level is not None:
        query_parameters['scanLevel'] = _SERIALIZER.query(
            "scan_level", scan_level, 'str')
    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="PUT",
                       url=url,
                       params=query_parameters,
                       headers=header_parameters,
                       **kwargs)
コード例 #23
0
def build_create_trigger_request(
    data_source_name: str,
    scan_name: str,
    *,
    json: Any = None,
    content: Any = None,
    **kwargs: Any
) -> HttpRequest:
    """Creates an instance of a trigger.

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

    :param data_source_name:
    :type data_source_name: str
    :param scan_name:
    :type scan_name: str
    :keyword json:
    :paramtype json: Any
    :keyword content:
    :paramtype content: Any
    :return: Returns an :class:`~azure.purview.scanning.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.scanning.core.rest.HttpRequest

    Example:
        .. code-block:: python


            # JSON input template you can fill out and use as your `json` input.
            json = {
                "properties": {}
            }


            # response body for status code(s): 200, 201
            response_body == {
                "properties": {}
            }

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

    # Construct URL
    url = kwargs.pop("template_url", '/datasources/{dataSourceName}/scans/{scanName}/triggers/default')
    path_format_arguments = {
        'dataSourceName': _SERIALIZER.url("data_source_name", data_source_name, 'str'),
        'scanName': _SERIALIZER.url("scan_name", scan_name, 'str'),
    }
    url = _format_url_section(url, **path_format_arguments)

    # 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="PUT",
        url=url,
        params=query_parameters,
        headers=header_parameters,
        json=json,
        content=content,
        **kwargs
    )