你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

如何管理法律标记

在本文中,你将了解如何在 Azure Data Manager for Energy 实例中管理法律标记。 法律标记是表示 Azure Data Manager for Energy 实例中数据的法律状态的实体。 法律标记是一个属性集合,用于管理数据的引入和使用方式。 将数据引入到 Azure Data Manager for Energy 实例中需要一个法定标记。 此外,还需要使用 Azure Data Manager for Energy 实例中的数据。 法律标记是在数据分区级别单独定义的。

在 Azure Data Manager for Energy 实例中, 权利服务 定义对给定用户的数据的访问权限,法律标记定义对用户数据的总体访问权限。 用户可能有权管理数据分区中的数据,但是,在满足某些法律要求之前,他们可能无法执行此操作。

在 Azure Cloud Bash 中运行以下命令,为 Azure Data Manager for Energy 实例的给定数据分区创建法定标记。

    curl --location --request POST 'https://<URI>/api/legal/v1/legaltags' \
    --header 'data-partition-id: <data-partition-id>' \
    --header 'Authorization: Bearer <access_token>' \
    --header 'Content-Type: application/json' \
    --data-raw '{
        "name": "<legal-tag-name>",
        "description": "<legal-tag-description>",
        "properties": {
            "contractId": "<contract-id>",
            "countryOfOrigin": ["<country-of-origin>"],
            "dataType": "<data-type>",
            "expirationDate": "<expiration-ID>",
            "exportClassification": "<export-classification>",
            "originator": "<originator>",
            "personalData": "<personal-data>",
            "securityClassification": "Public"
        }
    }'

示例请求

考虑名为“medstest”的 Azure Data Manager for Energy 实例,其数据分区名为“dp1”

    curl --location --request POST 'https://medstest.energy.azure.com/api/legal/v1/legaltags' \
    --header 'data-partition-id: medstest-dp1' \
    --header 'Authorization: Bearer  eyxxxxxxx.........................' \
    --header 'Content-Type: application/json' \
    --data-raw '{
        "name": "medstest-dp1-legal-tag",
        "description": "Azure Data Manager for Energy Legal Tag",
        "properties": {
            "contractId": "A1234",
            "countryOfOrigin": ["US"],
            "dataType": "Public Domain Data",
            "expirationDate": "2099-01-25",
            "exportClassification": "EAR99",
            "originator": "MyCompany",
            "personalData": "No Personal Data",
            "securityClassification": "Public"
        }
    }'

示例响应

    {
        "name": "medsStest-dp1-legal-tag",
        "description": "Azure Data Manager for Energy Legal Tag",
        "properties": {
        "countryOfOrigin": [
            "US"
        ],
        "contractId": "A1234",
        "expirationDate": "2099-01-25",
        "originator": "MyCompany",
        "dataType": "Public Domain Data",
        "securityClassification": "Public",
        "personalData": "No Personal Data",
        "exportClassification": "EAR99"
    }
}

源国家/地区应遵循 ISO Alpha2 格式

创建法律标记 API,在内部将数据分区 ID 追加到法律标记名称(如果尚不存在)。 例如,如果请求的名称为:legal-tag,则创建的法律标记名称将为 <instancename>-<data-partition-id>-legal-tag

    curl --location --request POST 'https://medstest.energy.azure.com/api/legal/v1/legaltags' \
    --header 'data-partition-id: medstest-dp1' \
    --header 'Authorization: Bearer  eyxxxxxxx.........................' \
    --header 'Content-Type: application/json' \
    --data-raw '{
        "name": "legal-tag",
        "description": "Azure Data Manager for Energy Legal Tag",
        "properties": {
            "contractId": "A1234",
            "countryOfOrigin": ["US"],
            "dataType": "Public Domain Data",
            "expirationDate": "2099-01-25",
            "exportClassification": "EAR99",
            "originator": "MyCompany",
            "personalData": "No Personal Data",
            "securityClassification": "Public"
        }
    }'

示例响应会将数据分区 ID 追加到法定标记名称,示例响应将为:

    {
        "name": "medstest-dp1-legal-tag",
        "description": "Azure Data Manager for Energy Legal Tag",
        "properties": {
        "countryOfOrigin": [
            "US"
        ],
        "contractId": "A1234",
        "expirationDate": "2099-01-25",
        "originator": "MyCompany",
        "dataType": "Public Domain Data",
        "securityClassification": "Public",
        "personalData": "No Personal Data",
        "exportClassification": "EAR99"
    }
}

在 Azure Cloud Bash 中运行以下 curl 命令,获取与 Azure Data Manager for Energy 实例的数据分区关联的法定标记。

    curl --location --request GET 'https://<URI>/api/legal/v1/legaltags/<legal-tag-name>' \
    --header 'data-partition-id: <data-partition-id>' \
    --header 'Authorization: Bearer <access_token>'

示例请求

考虑名为“medstest”的 Azure Data Manager for Energy 实例,其数据分区名为“dp1”

    curl --location --request GET 'https://medstest.energy.azure.com/api/legal/v1/legaltags/medstest-dp1-legal-tag' \
    --header 'data-partition-id: medstest-dp1' \
    --header 'Authorization: Bearer eyxxxxxxx.........................'

示例响应

    {
    "name": "medstest-dp1-legal-tag",
    "description": "Azure Data Manager for Energy Legal Tag",
    "properties": {
        "countryOfOrigin": [
        "US"
        ],
        "contractId": "A1234",
        "expirationDate": "2099-01-25",
        "originator": "MyCompany",
        "dataType": "Public Domain Data",
        "securityClassification": "Public",
        "personalData": "No Personal Data",
        "exportClassification": "EAR99"
    }
    }

后续步骤