# 전역

## 개요

다음 API 작업을 사용하여 상호작용하세요 [글로벌 헬퍼 함수](https://docs.panther.com/ko/detections/rules/python/globals) Panther에서 ("글로벌 헬퍼" 및 단순히 "글로벌"이라고도 함).

API를 호출하려면, [Panther REST API 사용 방법](https://docs.panther.com/ko/panther/api/rest/..#how-to-use-the-panther-rest-api) 지침을 참조하세요—포함하여 [이 문서 페이지에서 직접 호출하는 방법에 대한 지침](https://docs.panther.com/ko/panther/api/rest/..#step-3-invoke-the-panther-rest-api).

## 필수 권한

* 에 대해 `GET` 작업의 경우, API 토큰에는 `룰 보기` 또는 `정책 보기` 권한이 있어야 합니다.
* 에 대해 `POST`, `PUT`및 `DELETE` 작업의 경우, API 토큰에는 `룰 관리` 또는 `정책 관리` 권한이 있어야 합니다.

## 작업

## POST /globals

> create global

```json
{"openapi":"3.0.3","info":{"title":"Panther REST API","version":"1.0"},"tags":[{"name":"global","description":"The global api handles all operations for globals"}],"servers":[{"url":"https://{api_host}","variables":{"api_host":{"default":"your-api-host"}}}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","name":"X-API-Key","in":"header"}},"schemas":{"GlobalAPI.ModifyGlobal":{"type":"object","properties":{"body":{"type":"string","description":"The python body of the global"},"description":{"type":"string","description":"The description of the global"},"id":{"type":"string","description":"The id of the global"},"tags":{"type":"array","items":{"type":"string"},"description":"The tags for the global"}},"required":["id","body"]},"GlobalAPI.Global":{"type":"object","properties":{"body":{"type":"string","description":"The python body of the global"},"createdAt":{"type":"string"},"description":{"type":"string","description":"The description of the global"},"id":{"type":"string","description":"The id of the global"},"lastModified":{"type":"string"},"tags":{"type":"array","items":{"type":"string"},"description":"The tags for the global"}}},"GlobalAPI.BadRequestError":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"GlobalAPI.ExistsError":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"paths":{"/globals":{"post":{"tags":["global"],"summary":"create global","operationId":"global#create","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlobalAPI.ModifyGlobal"}}}},"responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlobalAPI.Global"}}}},"400":{"description":"bad_request: Bad Request response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlobalAPI.BadRequestError"}}}},"409":{"description":"exists: Conflict response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlobalAPI.ExistsError"}}}}}}}}}
```

## GET /globals/{id}

> get global

```json
{"openapi":"3.0.3","info":{"title":"Panther REST API","version":"1.0"},"tags":[{"name":"global","description":"The global api handles all operations for globals"}],"servers":[{"url":"https://{api_host}","variables":{"api_host":{"default":"your-api-host"}}}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","name":"X-API-Key","in":"header"}},"schemas":{"GlobalAPI.Global":{"type":"object","properties":{"body":{"type":"string","description":"The python body of the global"},"createdAt":{"type":"string"},"description":{"type":"string","description":"The description of the global"},"id":{"type":"string","description":"The id of the global"},"lastModified":{"type":"string"},"tags":{"type":"array","items":{"type":"string"},"description":"The tags for the global"}}},"GlobalAPI.NotFoundError":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"paths":{"/globals/{id}":{"get":{"tags":["global"],"summary":"get global","operationId":"global#get","parameters":[{"name":"id","in":"path","description":"ID of the global to fetch","required":true,"schema":{"type":"string","description":"ID of the global to fetch"}}],"responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlobalAPI.Global"}}}},"404":{"description":"not_found: Not Found response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlobalAPI.NotFoundError"}}}}}}}}}
```

## put global

> put creates or updates a global

```json
{"openapi":"3.0.3","info":{"title":"Panther REST API","version":"1.0"},"tags":[{"name":"global","description":"The global api handles all operations for globals"}],"servers":[{"url":"https://{api_host}","variables":{"api_host":{"default":"your-api-host"}}}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","name":"X-API-Key","in":"header"}},"schemas":{"GlobalAPI.ModifyGlobal2":{"type":"object","properties":{"body":{"type":"string","description":"The python body of the global"},"description":{"type":"string","description":"The description of the global"},"tags":{"type":"array","items":{"type":"string"},"description":"The tags for the global"}},"required":["body"]},"GlobalAPI.PutGlobalResp":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/GlobalAPI.Global"}}},"GlobalAPI.Global":{"type":"object","properties":{"body":{"type":"string","description":"The python body of the global"},"createdAt":{"type":"string"},"description":{"type":"string","description":"The description of the global"},"id":{"type":"string","description":"The id of the global"},"lastModified":{"type":"string"},"tags":{"type":"array","items":{"type":"string"},"description":"The tags for the global"}}},"GlobalAPI.BadRequestError":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"paths":{"/globals/{id}":{"put":{"tags":["global"],"summary":"put global","description":"put creates or updates a global","operationId":"global#put","parameters":[{"name":"id","in":"path","description":"The id of the global","required":true,"schema":{"type":"string","description":"The id of the global"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlobalAPI.ModifyGlobal2"}}}},"responses":{"200":{"description":"200 returned if the item already existed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlobalAPI.PutGlobalResp"}}}},"201":{"description":"201 returned if the item was created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlobalAPI.PutGlobalResp"}}}},"400":{"description":"bad_request: Bad Request response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlobalAPI.BadRequestError"}}}}}}}}}
```

## DELETE /globals/{id}

> delete global

```json
{"openapi":"3.0.3","info":{"title":"Panther REST API","version":"1.0"},"tags":[{"name":"global","description":"The global api handles all operations for globals"}],"servers":[{"url":"https://{api_host}","variables":{"api_host":{"default":"your-api-host"}}}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","name":"X-API-Key","in":"header"}},"schemas":{"GlobalAPI.BadRequestError":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"GlobalAPI.NotFoundError":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}},"paths":{"/globals/{id}":{"delete":{"tags":["global"],"summary":"delete global","operationId":"global#delete","parameters":[{"name":"id","in":"path","description":"ID of the global to delete","required":true,"schema":{"type":"string","description":"ID of the global to delete"}}],"responses":{"204":{"description":"No Content response."},"400":{"description":"bad_request: Bad Request response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlobalAPI.BadRequestError"}}}},"404":{"description":"not_found: Not Found response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlobalAPI.NotFoundError"}}}}}}}}}
```

## GET /globals

> list globals

```json
{"openapi":"3.0.3","info":{"title":"Panther REST API","version":"1.0"},"tags":[{"name":"global","description":"The global api handles all operations for globals"}],"servers":[{"url":"https://{api_host}","variables":{"api_host":{"default":"your-api-host"}}}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","name":"X-API-Key","in":"header"}},"schemas":{"GlobalAPI.ListResp":{"type":"object","properties":{"next":{"type":"string","description":"pagination token for the next page of results"},"results":{"type":"array","items":{"$ref":"#/components/schemas/GlobalAPI.Global"}}}},"GlobalAPI.Global":{"type":"object","properties":{"body":{"type":"string","description":"The python body of the global"},"createdAt":{"type":"string"},"description":{"type":"string","description":"The description of the global"},"id":{"type":"string","description":"The id of the global"},"lastModified":{"type":"string"},"tags":{"type":"array","items":{"type":"string"},"description":"The tags for the global"}}}}},"paths":{"/globals":{"get":{"tags":["global"],"summary":"list globals","operationId":"global#list","parameters":[{"name":"cursor","in":"query","description":"the pagination token","allowEmptyValue":true,"schema":{"type":"string","description":"the pagination token"}},{"name":"limit","in":"query","description":"the maximum results to return","allowEmptyValue":true,"schema":{"type":"integer","description":"the maximum results to return","default":100,"format":"int64"}},{"name":"name-contains","in":"query","description":"Substring search by name (case-insensitive)","allowEmptyValue":true,"schema":{"type":"string","description":"Substring search by name (case-insensitive)"}},{"name":"created-by","in":"query","description":"Only include rules whose creator matches this user ID or actor ID","allowEmptyValue":true,"schema":{"type":"string","description":"Only include rules whose creator matches this user ID or actor ID"}},{"name":"last-modified-by","in":"query","description":"Only include rules last modified by this user ID or actor ID","allowEmptyValue":true,"schema":{"type":"string","description":"Only include rules last modified by this user ID or actor ID"}}],"responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlobalAPI.ListResp"}}}}}}}}}
```
