라벨 사용 중지, 사용 설정, 삭제
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
이 페이지에서는 라벨과 관련된 다음 작업을 수행하는 방법을 설명합니다.
- 라벨 사용 중지하기
- 라벨 사용 설정하기
- 라벨 삭제
라벨 사용 중지하기
라벨을 사용 중지하면 현재 게시된 버전을 기반으로 사용 중지된 새 게시 버전이 생성됩니다. 초안 버전이 있으면 최신 초안 버전을 기반으로 사용 중지된 새 초안 버전이 생성됩니다. 이전 임시보관 버전이 삭제됩니다. 자세한 내용은 라벨 수명 주기를 참고하세요.
사용 중지된 후에도 사용자는 API를 통해 이 라벨을 적용할 수 있습니다. 라벨은 이미 적용된 위치와 검색 결과에 계속 표시됩니다. 사용 중지된 라벨은 삭제할 수 있습니다.
게시된 라벨을 사용 중지하려면 labels
컬렉션에서 disable
메서드를 사용합니다.
다음도 지정해야 합니다.
이 예시에서는 ID
를 사용하여 올바른 라벨을 사용 중지합니다.
Python
service.labels().disable(
name='labels/ID',
body={
'use_admin_access': True
}).execute()
Node.js
service.labels.disable({
'resource': {
'use_admin_access': true
},
'name': 'labels/ID'
}, (err, res) => {
if (err) return console.error('The API returned an error: ' + err);
console.log(res);
});
라벨에 DISABLED
의 State
이 있고 라벨의 버전 ID가 증가합니다. 사용자는 API를 통해 라벨을 적용할 수 있습니다. 하지만 disabledPolicy
메서드의 showInApply
속성이 구성되지 않으면 사용 중지된 라벨이 UI에 표시되지 않습니다.
라벨 사용 설정하기
사용 중지된 라벨을 사용 설정하면 게시된 상태로 복원됩니다. 이로 인해 현재 사용 중지된 게시 버전이 기반인 새 게시 버전이 생성됩니다. 사용 중지된 기존 초안 버전이 있으면 해당 초안을 기반으로 새 버전이 생성되고 사용 설정됩니다. 자세한 내용은 라벨 수명 주기를 참고하세요.
사용 중지된 라벨을 사용 설정하려면 enable
메서드를 사용합니다.
다음도 지정해야 합니다.
이 예시에서는 ID
를 사용하여 올바른 라벨을 사용 설정합니다.
Python
service.labels().enable(
name='labels/ID',
body={
'use_admin_access': True
}).execute()
Node.js
service.labels.enable({
'resource': {
'use_admin_access': true
},
'name': 'labels/ID'
}, (err, res) => {
if (err) return console.error('The API returned an error: ' + err);
console.log(res);
});
라벨에 PUBLISHED
의 State
이 있고 라벨의 버전 ID가 증가합니다. 사용자는 API를 통해 파일에 라벨을 보고 적용할 수 있습니다.
라벨 삭제
초안 및 사용 중지된 라벨만 삭제할 수 있습니다. 라벨이 삭제되면 사용자가 입력한 모든 필드 값을 비롯해 라벨이 적용되었던 모든 인스턴스가 영구적으로 삭제되고 해당 Drive 파일에서 삭제됩니다.
라벨을 삭제하려면 먼저 라벨을 사용 중지한 다음 delete
메서드를 사용해야 합니다.
다음도 지정해야 합니다.
이 예시에서는 ID
를 사용하여 올바른 라벨을 삭제합니다.
Python
response = service.labels().delete(
name='labels/ID',
useAdminAccess=True).execute()
Node.js
service.labels.delete({
'name': 'labels/ID',
'use_admin_access': true
}, (err, res) => {
if (err) return console.error('The API returned an error: ' + err);
console.log(res);
});
라벨에 DELETED
의 State
이 있고 라벨의 버전 ID가 증가합니다. 라벨을 적용할 수 없으며 삭제된 라벨은 결국 삭제됩니다. 자세한 내용은 라벨 수명 주기를 참고하세요.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-08-29(UTC)
[null,null,["최종 업데이트: 2025-08-29(UTC)"],[],[],null,["# Disable, enable & delete a label\n\nThis page describes how to perform these tasks involving labels:\n\n- Disable a label\n- Enable a label\n- Delete a label\n\nDisable a label\n---------------\n\nDisabling a label results in a new disabled published revision based on the\ncurrent published revision. If there's a draft revision, a new disabled draft\nrevision is created based on the latest draft revision. Older draft revisions\nare deleted. For more information, see [Label\nlifecycle](/workspace/drive/labels/guides/label-lifecycle).\n\nOnce disabled, users can still apply this label through the API. The label still\nappears where it's already been applied and in your search results. A disabled\nlabel can be [deleted](#delete).\n\nTo disable a published label, use the\n[`disable`](/workspace/drive/labels/reference/rest/v2/labels/disable) method on the\n[`labels`](/workspace/drive/labels/reference/rest/v2/labels) collection.\n\nYou also must specify:\n\n- A [Label resource](/workspace/drive/labels/reference/rest/v2/labels#resource:-label)\n that represents every label. It contains a resource `Name` and `ID`, which\n is a globally unique identifier for the label.\n\n- `useAdminAccess` is `true` to use the user's administrator credentials. The\n server verifies that the user is an admin for the label before allowing\n access.\n\nThis example uses the `ID` to disable the correct label. \n\n### Python\n\n service.labels().disable(\n name='labels/\u003cvar translate=\"no\"\u003eID\u003c/var\u003e',\n body={\n 'use_admin_access': True\n }).execute()\n\n### Node.js\n\n service.labels.disable({\n 'resource': {\n 'use_admin_access': true\n },\n 'name': 'labels/\u003cvar translate=\"no\"\u003eID\u003c/var\u003e'\n }, (err, res) =\u003e {\n if (err) return console.error('The API returned an error: ' + err);\n console.log(res);\n });\n\nThe label has the [`State`](/workspace/drive/labels/reference/rest/v2/labels#state) of\n`DISABLED` and the label's revision ID is incremented. Users can apply the label\nthrough the API. However, a disabled label is not shown in a UI unless the\n`showInApply` property of the\n[`disabledPolicy`](/workspace/drive/labels/reference/rest/v2/labels#DisabledPolicy) method\nis configured.\n\nEnable a label\n--------------\n\nEnabling a disabled label restores it to its published state. It results in a\nnew published revision based on the current disabled published revision. If\nthere's an existing disabled draft revision, a new revision is created based on\nthat draft and is enabled. For more information, see [Label\nlifecycle](/workspace/drive/labels/guides/label-lifecycle).\n\nTo enable a disabled label, use the\n[`enable`](/workspace/drive/labels/reference/rest/v2/labels/enable) method.\n\nYou also must specify:\n\n- A [Label resource](/workspace/drive/labels/reference/rest/v2/labels#resource:-label)\n that represents every label. It contains a resource `Name` and `ID`, which\n is a globally unique identifier for the label.\n\n- `useAdminAccess` is `true` to use the user's administrator credentials. The\n server verifies that the user is an admin for the label before allowing\n access.\n\nThis example uses the `ID` to enable the correct label. \n\n### Python\n\n service.labels().enable(\n name='labels/\u003cvar translate=\"no\"\u003eID\u003c/var\u003e',\n body={\n 'use_admin_access': True\n }).execute()\n\n### Node.js\n\n service.labels.enable({\n 'resource': {\n 'use_admin_access': true\n },\n 'name': 'labels/\u003cvar translate=\"no\"\u003eID\u003c/var\u003e'\n }, (err, res) =\u003e {\n if (err) return console.error('The API returned an error: ' + err);\n console.log(res);\n });\n\nThe label has the [`State`](/workspace/drive/labels/reference/rest/v2/labels#state) of\n`PUBLISHED` and the label's revision ID is incremented. Users can view and apply\nthe label to files through the API.\n\nDelete a label\n--------------\n\nOnly draft and disabled labels can be deleted. When a label is deleted, all\ninstances where the label was previously applied, including any corresponding\nfield values entered by users, are permanently deleted and removed from those\nDrive files.\n\nTo delete a label, you must first disable it and then use the\n[`delete`](/workspace/drive/labels/reference/rest/v2/labels/delete) method.\n\nYou also must specify:\n\n- A [Label resource](/workspace/drive/labels/reference/rest/v2/labels#resource:-label)\n that represents every label. It contains a resource `Name` and `ID`, which\n is a globally unique identifier for the label.\n\n- `useAdminAccess` is `true` to use the user's administrator credentials. The\n server verifies that the user is an admin for the label before allowing\n access.\n\nThis example uses the `ID` to delete the correct label. \n\n### Python\n\n response = service.labels().delete(\n name='labels/\u003cvar translate=\"no\"\u003eID\u003c/var\u003e',\n useAdminAccess=True).execute()\n\n### Node.js\n\n service.labels.delete({\n 'name': 'labels/\u003cvar translate=\"no\"\u003eID\u003c/var\u003e',\n 'use_admin_access': true\n }, (err, res) =\u003e {\n if (err) return console.error('The API returned an error: ' + err);\n console.log(res);\n });\n\nThe label has the [`State`](/workspace/drive/labels/reference/rest/v2/labels#state) of\n`DELETED` and the label's revision ID is incremented. The label cannot be\napplied and deleted labels are eventually purged. For more information, see\n[Label lifecycle](/workspace/drive/labels/guides/label-lifecycle)."]]