Skip to main content
Мы публикуем частые обновления нашей документации, и перевод этой страницы может все еще выполняться. Актуальные сведения см. в документации на английском языке.

Диспетчеры безопасности

Используйте REST API для управления диспетчерами безопасности в организации.

Сведения о диспетчерах безопасности

Примечание. Роль диспетчера безопасности находится на этапе общедоступной бета-версии и может быть изменена.

Менеджер по безопасности — это роль уровня организации, которую владельцы организации могут назначать любой команде в организации. Эта роль предоставляет каждому участнику команды разрешения на управление оповещениями системы безопасности и параметрами в масштабах всей организации, а также разрешения на чтение для всех репозиториев в организации.

List security manager teams

Работа с GitHub Apps

Lists teams that are security managers for an organization. For more information, see "Managing security managers in your organization."

To use this endpoint, you must be an administrator or security manager for the organization, and you must use an access token with the read:org scope.

GitHub Apps must have the administration organization read permission to use this endpoint.

Параметры для "List security manager teams"

Заголовки
Имя, Тип, Описание
accept string

Setting to application/vnd.github+json is recommended.

Параметры пути
Имя, Тип, Описание
org string Обязательно

The organization name. The name is not case sensitive.

Коды состояния HTTP-ответа для "List security manager teams"

Код состоянияОписание
200

OK

Примеры кода для "List security manager teams"

get/orgs/{org}/security-managers
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ http(s)://HOSTNAME/api/v3/orgs/ORG/security-managers

Response

Status: 200
[ { "id": 1, "node_id": "MDQ6VGVhbTE=", "url": "https://HOSTNAME/teams/1", "html_url": "https://github.com/orgs/github/teams/justice-league", "name": "Justice League", "slug": "justice-league", "description": "A great team.", "privacy": "closed", "permission": "admin", "members_url": "https://HOSTNAME/teams/1/members{/member}", "repositories_url": "https://HOSTNAME/teams/1/repos", "parent": null } ]

Add a security manager team

Работа с GitHub Apps

Adds a team as a security manager for an organization. For more information, see "Managing security for an organization for an organization."

To use this endpoint, you must be an administrator for the organization, and you must use an access token with the write:org scope.

GitHub Apps must have the administration organization read-write permission to use this endpoint.

Параметры для "Add a security manager team"

Заголовки
Имя, Тип, Описание
accept string

Setting to application/vnd.github+json is recommended.

Параметры пути
Имя, Тип, Описание
org string Обязательно

The organization name. The name is not case sensitive.

team_slug string Обязательно

The slug of the team name.

Коды состояния HTTP-ответа для "Add a security manager team"

Код состоянияОписание
204

No Content

409

The organization has reached the maximum number of security manager teams.

Примеры кода для "Add a security manager team"

put/orgs/{org}/security-managers/teams/{team_slug}
curl -L \ -X PUT \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ http(s)://HOSTNAME/api/v3/orgs/ORG/security-managers/teams/TEAM_SLUG

Response

Status: 204

Remove a security manager team

Работа с GitHub Apps

Removes the security manager role from a team for an organization. For more information, see "Managing security managers in your organization team from an organization."

To use this endpoint, you must be an administrator for the organization, and you must use an access token with the admin:org scope.

GitHub Apps must have the administration organization read-write permission to use this endpoint.

Параметры для "Remove a security manager team"

Заголовки
Имя, Тип, Описание
accept string

Setting to application/vnd.github+json is recommended.

Параметры пути
Имя, Тип, Описание
org string Обязательно

The organization name. The name is not case sensitive.

team_slug string Обязательно

The slug of the team name.

Коды состояния HTTP-ответа для "Remove a security manager team"

Код состоянияОписание
204

No Content

Примеры кода для "Remove a security manager team"

delete/orgs/{org}/security-managers/teams/{team_slug}
curl -L \ -X DELETE \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ http(s)://HOSTNAME/api/v3/orgs/ORG/security-managers/teams/TEAM_SLUG

Response

Status: 204