Skip to main content

Enterprise Server 3.19 은(는) 현재 릴리스 후보로 제공됩니다.

이제 REST API의 버전이 지정되었습니다. 자세한 내용은 "API 버전 관리 정보"를 참조하세요.

규칙에 대한 REST API 엔드포인트

REST API를 사용하여 엔터프라이즈에 대한 규칙 집합을 관리합니다. 규칙 집합은 사용자가 리포지토리와 코드와 상호 작용하는 방법을 제어합니다.

Get enterprise ruleset history

Get the history of an enterprise ruleset.

"Get enterprise ruleset history"에 대한 세분화된 액세스 토큰

이 엔드포인트는 GitHub 앱 사용자 액세스 토큰, GitHub 앱 설치 액세스 토큰 또는 세분화된 개인용 액세스 토큰에서 작동하지 않습니다.

"Get enterprise ruleset history"에 대한 매개 변수

머리글
속성, 형식, 설명
accept string

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

경로 매개 변수
속성, 형식, 설명
enterprise string Required

The slug version of the enterprise name.

ruleset_id integer Required

The ID of the ruleset.

쿼리 매개 변수
속성, 형식, 설명
per_page integer

The number of results per page (max 100). For more information, see "Using pagination in the REST API."

기본값: 30

page integer

The page number of the results to fetch. For more information, see "Using pagination in the REST API."

기본값: 1

"Get enterprise ruleset history"에 대한 HTTP 응답 상태 코드

상태 코드설명
200

OK

404

Resource not found

500

Internal Error

"Get enterprise ruleset history"에 대한 코드 샘플

요청 예제

get/enterprises/{enterprise}/rulesets/{ruleset_id}/history
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ http(s)://HOSTNAME/api/v3/enterprises/ENTERPRISE/rulesets/RULESET_ID/history

Response

Status: 200
[ { "version_id": 3, "actor": { "id": 1, "type": "User" }, "updated_at": "2024-010-23T16:29:47Z" }, { "version_id": 2, "actor": { "id": 2, "type": "User" }, "updated_at": "2024-09-23T16:29:47Z" }, { "version_id": 1, "actor": { "id": 1, "type": "User" }, "updated_at": "2024-08-23T16:29:47Z" } ]

Get enterprise ruleset version

Get a version of an enterprise ruleset.

"Get enterprise ruleset version"에 대한 세분화된 액세스 토큰

이 엔드포인트는 GitHub 앱 사용자 액세스 토큰, GitHub 앱 설치 액세스 토큰 또는 세분화된 개인용 액세스 토큰에서 작동하지 않습니다.

"Get enterprise ruleset version"에 대한 매개 변수

머리글
속성, 형식, 설명
accept string

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

경로 매개 변수
속성, 형식, 설명
enterprise string Required

The slug version of the enterprise name.

ruleset_id integer Required

The ID of the ruleset.

version_id integer Required

The ID of the version

"Get enterprise ruleset version"에 대한 HTTP 응답 상태 코드

상태 코드설명
200

OK

404

Resource not found

500

Internal Error

"Get enterprise ruleset version"에 대한 코드 샘플

요청 예제

get/enterprises/{enterprise}/rulesets/{ruleset_id}/history/{version_id}
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ http(s)://HOSTNAME/api/v3/enterprises/ENTERPRISE/rulesets/RULESET_ID/history/VERSION_ID

Response

Status: 200
[ { "version_id": 3, "actor": { "id": 1, "type": "User" }, "updated_at": "2024-010-23T16:29:47Z", "state": { "id": 21, "name": "super cool ruleset", "target": "repository", "source_type": "Enterprise", "source": "my-enterprise", "enforcement": "active", "conditions": { "organization_name": { "include": [ "important_organization" ] }, "repository_name": { "include": [ "~ALL" ] } }, "rules": [ { "type": "repository_delete" } ] } } ]