glossary-values/{value-id}

使用此资源来删除词汇表中的值。

方法概要

HTTP 方法 路径 描述
DELETE DELETE bwl/glossary-values/ {value-id} 删除词汇表中的值。

删除 bwl/glossary-values/{value-id}

描述
使用此方法以删除任何类别中的任何预定义值或定制词汇表值,tag 除外。 只能删除当前未在其他工件中使用或者其他词汇表值中未引用的词汇表值。
资源信息
需求 描述
响应格式 JSON
需要认证 是。 用户必须是词汇表管理员和帐户管理员,并且“管理员在所有空间、所有用户组和词汇表中都具有完整许可权”必须开启。
支持 OAuth 2 客户机凭证 是,使用包含工件编写类别的用户服务标识
限制速度 IBM Blueworks Live 将应用速率限制,以确定在特定时间段内可以调用此 API 的频率。 允许的速率为每小时 200 个请求。

速率限制将应用于整个帐户。 即使使用了不同的认证方法,也会在所有用户上应用单个帐户范围的速率。

当账户的 API 速率超出限制时,下一个请求将被拒绝,状态代码为 429,响应标头为Retry-After,表示下次可以发出请求的秒数。

参数
名称 位置 描述 必需 Type
X-On-Behalf-Of 页眉 用户上下文。 该值必须是帐户中的管理员。 用户必须有权删除帐户中的词汇表值。 必需 (如果使用了服务标识 OAuth 凭证)。 使用用户服务标识 OAuth 凭证时不需要。 字符串
id 路径 要删除的词汇表值的标识。 字符串
force 查询 强制删除。 如果将此参数设置为 true,那么将删除词汇表值,即使先前已在其他工件中使用。 将在响应中汇总警告。 布尔值
响应
示例 1 输入 - 删除定制词汇表值
尝试删除定制词汇表值。
  • 使用用户服务标识 OAuth 2 客户机凭证:
    curl -i -H "Authorization: Bearer access_token"  
     "https://your_server_url/bwl/glossary-value/2500d8/usage"
  • 使用服务标识 OAuth 2 客户机凭证:
    curl -i -H "Authorization: Bearer access_token"  
     "https://your_server_url/bwl/glossary-value/2500d8/usage"
  • 将服务标识 OAuth 2 客户机凭证与用户上下文配合使用:
    curl -i -H "Authorization: Bearer access_token" -H "X-On-Behalf-Of:user_name@domain.com"
     "https://your_server_url/bwl/glossary-value/2500d8/usage"
示例 1 输出 - 删除定制词汇表值
在此示例中,词汇表值已在使用且不会被删除。 以下是可能的用法部分:
  • active-usages:词汇表值仍在这些工件中处于活动使用状态。
  • historical-usages:词汇表值已在这些工件中使用,但是不再使用。
  • glossary-usages:从这些词汇表项引用词汇表值。
  • user-usages:词汇表值是业务单元并且从这些用户设置进行引用。
HTTP/1.1 409 Conflict
{
    "developer-message": "This glossary value cannot be deleted because it is in use.",
    "user-message": "This glossary value cannot be deleted because it is in use.",
    "active-usages": [
        {
            "id": "2009f6",
            "name": "Process1",
            "type": "blueprint",
            "space-ids": [
                "13130b"
            ],
            "space-names": [
                "ASpace"
            ],
            "archived-state": "active",
            "published-state": "unpublished",
            "last-modified-date": "2020-09-22T17:13:14.121+0000"
        },
        {
            "id": "200c3a",
            "name": "Process3",
            "type": "blueprint",
            "space-ids": [
                "13130b"
            ],
            "space-names": [
                "ASpace"
            ],
            "archived-state": "archived",
            "published-state": "unpublished",
            "last-modified-date": "2020-09-22T17:14:59.862+0000"
        }
    ],
    "glossary-usages": [
        {
            "id": "13138a",
            "name": "GlossaryValue1",
            "category": "customProperty1",
            "active-state": "active",
            "enumerated": false,
            "usage-type": "reference"
        }
    ],
    "historical-usages": [
        {
            "id": "200c0c",
            "name": "Process2",
            "type": "blueprint",
            "archived-state": "active",
            "last-modified-date": "2020-09-22T17:14:46.551+0000"
        }
    ]
}
示例 2 输入 - 强制删除业务单元词汇表项
尝试强制删除业务单元词汇表项。
  • 使用用户服务标识 OAuth 2 客户机凭证:
    curl -i -H "Authorization: Bearer access_token"  
     "https://your_server_url/bwl/glossary-value/2500d8/usage"
  • 使用服务标识 OAuth 2 客户机凭证:
    curl -i -H "Authorization: Bearer access_token"  
     "https://your_server_url/bwl/glossary-value/2500d8/usage"
  • 将服务标识 OAuth 2 客户机凭证与用户上下文配合使用:
    curl -i -H "Authorization: Bearer access_token" -H "X-On-Behalf-Of:user_name@domain.com"
     "https://your_server_url/bwl/glossary-value/2500d8/usage"
示例 2 输出 - 强制删除业务单元词汇表项
无法删除词汇表项,因为正在用户设置中使用。
HTTP/1.1 409 Conflict
{
    "developer-message": "This glossary value cannot be deleted because it is in use.",
    "user-message": "This glossary value cannot be deleted because it is in use.",
    "user-usages": [
        {
            "id": "4000c",
            "full-name": "John Doe",
            "email-address": "johndoe@domain.com"
        },
        {
            "id": "4000b",
            "full-name": "Jane Doe",
            "email-address": "janedoe@domain.com"
        },
        {
            "id": "40012",
            "full-name": "Mary Poppins",
            "email-address": "marypoppins@domain.com"
        }
    ]
}
示例 3 输入 - 删除不再处于活动使用状态的系统词汇表值
尝试删除不再处于活动使用状态的系统词汇表值。
  • 使用用户服务标识 OAuth 2 客户机凭证:
    curl -i -H "Authorization: Bearer access_token"  
     "https://your_server_url/bwl/glossary-value/2500d8/usage"
  • 使用服务标识 OAuth 2 客户机凭证:
    curl -i -H "Authorization: Bearer access_token"  
     "https://your_server_url/bwl/glossary-value/2500d8/usage"
  • 将服务标识 OAuth 2 客户机凭证与用户上下文配合使用:
    curl -i -H "Authorization: Bearer access_token" -H "X-On-Behalf-Of:user_name@domain.com"
     "https://your_server_url/bwl/glossary-value/2500d8/usage"
示例 3 输出 - 删除不再处于活动使用状态的系统词汇表值
在此示例中,不删除词汇表项,因为其仍在历史工件中使用。
HTTP/1.1 409 Conflict
{
    "developer-message": "This glossary value cannot be deleted because it is in use.",
    "user-message": "This glossary value cannot be deleted because it is in use.",
    "historical-usages": [
        {
            "id": "c00f7",
            "name": "Hiring - Onboarding",
            "type": "blueprint",
            "archived-state": "active",
            "last-modified-date": "2020-10-14T12:07:39.296+0000"
        }
    ]
}
示例 4 输入 - 强制删除不再处于活动使用状态的系统词汇表值
强制删除不再处于活动使用状态的系统词汇表值。
  • 使用用户服务标识 OAuth 2 客户机凭证:
    curl -i -H "Authorization: Bearer access_token"  
     "https://your_server_url/bwl/glossary-value/2500d8/usage"
  • 使用服务标识 OAuth 2 客户机凭证:
    curl -i -H "Authorization: Bearer access_token"  
     "https://your_server_url/bwl/glossary-value/2500d8/usage"
  • 将服务标识 OAuth 2 客户机凭证与用户上下文配合使用:
    curl -i -H "Authorization: Bearer access_token" -H "X-On-Behalf-Of:user_name@domain.com"
     "https://your_server_url/bwl/glossary-value/2500d8/usage"
示例 4 输出 - 强制删除不再处于活动使用状态的系统词汇表值
将删除词汇表项并生成警告。
HTTP/1.1 200 OK
{
    "developer-message": "Glossary value deleted with warnings. The glossary value was deleted, but it will reappear in the glossary if a snapshot that uses it is restored.",
    "user-message": "Glossary value deleted with warnings. The glossary value was deleted, but it will reappear in the glossary if a snapshot that uses it is restored.",
    "historical-usages": [
        {
            "id": "c00f7",
            "name": "Hiring - Onboarding",
            "type": "blueprint",
            "archived-state": "active",
            "last-modified-date": "2020-10-14T12:07:39.296+0000"
        }
    ]
}
响应头
标头名称 描述
Retry-After 可执行下一个请求的时间(以秒数表示)。
响应消息
HTTP 代码 原因
200

该请求已成功完成。

400 无法删除 tag 类别的词汇表值。
401
该用户未通过认证。 由于以下原因,可能出现此响应:
  • 提供了无效的用户名或密码。
  • 该用户属于多个帐户,而某个帐户在请求中未指定。
403 由于用户无权删除此词汇表值,因此该命令失败。
404 帐户中不存在此词汇表值。
409 因为词汇表值正在使用中或曾经使用过,命令失败。
429 请求已超过此帐户的 API 速率限制。

更多信息,请参阅 OpenAPI 规范