GS2-Log SDK API 레퍼런스
모델
Namespace
네임스페이스
네임스페이스는 하나의 프로젝트 내에서 동일한 서비스를 서로 다른 용도로 여러 개 이용하기 위한 엔티티입니다.
GS2의 각 서비스는 네임스페이스 단위로 관리됩니다. 네임스페이스가 다르면 동일한 서비스라도 완전히 독립된 데이터 공간으로 취급됩니다.
따라서 각 서비스의 이용을 시작하려면 먼저 네임스페이스를 생성해야 합니다.
상세
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| namespaceId | string | ※ | ~ 1024자 | 네임스페이스 GRN
※ 서버가 자동으로 설정 | ||||||||||
| name | string | ✓ | ~ 128자 | 네임스페이스 이름 네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. | ||||||||||
| description | string | ~ 1024자 | 설명문 | |||||||||||
| type | 문자열 열거형 enum { “gs2”, “bigquery”, “firehose” } | “gs2” | 로그 출력 방법 로그 데이터의 내보내기 대상을 결정합니다. “gs2"는 GS2의 매니지드 스토리지에 로그를 저장하며 내장된 검색·분석 기능을 이용할 수 있습니다. “bigquery"는 Google BigQuery로 로그를 내보내 고급 분석을 수행할 수 있습니다. “firehose"는 Amazon Kinesis Data Firehose로 로그를 스트리밍하여 S3, Redshift 등의 AWS 대상으로 전달합니다.
| |||||||||||
| gcpCredentialJson | string | {type} == “bigquery” | ✓※ | ~ 5120자 | GCP 자격 증명 BigQuery로 로그를 내보낼 때 인증에 사용하는 GCP 자격 증명 JSON입니다. 서비스 계정에는 대상 데이터셋에 대한 BigQuery Data Editor 권한이 필요합니다. ※ type이(가) “bigquery” 이면 필수 | |||||||||
| bigQueryDatasetName | string | {type} == “bigquery” | ✓※ | ~ 1024자 | BigQuery 데이터셋 이름 로그 데이터를 내보낼 대상이 되는 BigQuery 데이터셋의 이름입니다. 데이터셋은 제공된 자격 증명에 연결된 GCP 프로젝트 내에 미리 존재해야 합니다. ※ type이(가) “bigquery” 이면 필수 | |||||||||
| logExpireDays | int | {type} in [“gs2”, “bigquery”] | ✓※ | 0 ~ 3650 | 로그 보존 기간(일) 로그 데이터를 보관하는 일수입니다. 이 기간을 초과한 로그는 자동으로 삭제됩니다. 내보내기 방법이 “gs2” 또는 “bigquery"인 경우에 적용됩니다. 최대 3650일(약 10년)까지 설정할 수 있습니다. ※ type이(가) “gs2”,“bigquery"이면 필수 | |||||||||
| awsRegion | string | {type} == “firehose” | ✓※ | ~ 256자 | AWS 리전 Kinesis Data Firehose 전송 스트림이 존재하는 AWS 리전입니다(예: us-east-1, ap-northeast-1). ※ type이(가) “firehose” 이면 필수 | |||||||||
| awsAccessKeyId | string | {type} == “firehose” | ✓※ | ~ 256자 | AWS 액세스 키 ID Kinesis Data Firehose 인증에 사용하는 AWS 액세스 키 ID입니다. IAM 사용자에게는 지정된 Firehose 전송 스트림으로 레코드를 전송할 수 있는 권한이 필요합니다. ※ type이(가) “firehose” 이면 필수 | |||||||||
| awsSecretAccessKey | string | {type} == “firehose” | ✓※ | ~ 256자 | AWS 시크릿 액세스 키 Kinesis Data Firehose 인증을 위해 액세스 키 ID와 짝을 이루는 AWS 시크릿 액세스 키입니다. ※ type이(가) “firehose” 이면 필수 | |||||||||
| firehoseStreamName | string | {type} == “firehose” | ✓※ | ~ 256자 | Kinesis Firehose 스트림 이름 로그 데이터의 전송 대상이 되는 Kinesis Data Firehose 전송 스트림의 이름입니다. ※ type이(가) “firehose” 이면 필수 | |||||||||
| firehoseCompressData | 문자열 열거형 enum { “none”, “gzip” } | {type} == “firehose” | “none” | Kinesis Firehose로 출력하는 데이터를 압축할지 여부 Kinesis Data Firehose로 전송하기 전에 로그 데이터를 압축할지를 설정합니다. Gzip 압축을 사용하면 데이터 전송량과 스토리지 비용을 절감할 수 있습니다.
※ type이(가) “firehose” 이면 활성화 | ||||||||||
| status | string | “ACTIVE” | ~ 128자 | 상태 이 네임스페이스의 현재 작동 상태입니다. 네임스페이스가 활성 상태이며 로그 데이터를 수신하고 있는지를 나타냅니다. | ||||||||||
| createdAt | long | ※ | 현재 시각 | 생성일시 UNIX 시간·밀리초 ※ 서버가 자동으로 설정 | ||||||||||
| updatedAt | long | ※ | 현재 시각 | 최종 갱신일시 UNIX 시간·밀리초 ※ 서버가 자동으로 설정 | ||||||||||
| revision | long | 0 | 0 ~ 9223372036854775805 | 리비전 |
AccessLog
액세스 로그
마이크로서비스에 대한 요청 및 그 응답 내용을 기록한 로그입니다.
상세
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |
|---|---|---|---|---|---|---|
| timestamp | long | ✓ | 일시 API 요청이 처리된 일시입니다. | |||
| requestId | string | ✓ | ~ 1024자 | 요청 ID 각 API 요청에 할당되는 고유 식별자입니다. 특정 API 호출의 추적과 디버깅에 사용됩니다. | ||
| service | string | ✓ | ~ 1024자 | 마이크로서비스 종류 요청을 처리한 GS2 마이크로서비스의 이름입니다(예: account, inventory, limit). | ||
| method | string | ✓ | ~ 1024자 | 마이크로서비스 메서드 마이크로서비스에서 호출된 구체적인 API 메서드입니다(예: createNamespace, getItem). | ||
| userId | string | ~ 128자 | 사용자ID | |||
| request | string | ✓ | ~ 10485760자 | 요청 파라미터 API에 전송된 요청 파라미터의 전체 내용(JSON 형식)입니다. | ||
| result | string | ✓ | ~ 10485760자 | 응답 내용 API에서 반환된 응답의 전체 내용(JSON 형식)으로, 정상적인 결과와 에러 상세 정보를 모두 포함합니다. |
AccessLogCount
액세스 로그 집계
마이크로서비스 종류, 메서드, 사용자별로 그룹화된 액세스 로그 엔트리의 집계 건수입니다. API 사용 패턴 분석과 자주 호출되는 엔드포인트 파악에 사용됩니다.
상세
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |
|---|---|---|---|---|---|---|
| service | string | ~ 1024자 | 마이크로서비스 종류 GS2 마이크로서비스의 이름입니다. 집계의 그룹화 키로 사용됩니다. | |||
| method | string | ~ 1024자 | 마이크로서비스 메서드 구체적인 API 메서드입니다. 집계의 그룹화 키로 사용됩니다. | |||
| userId | string | ~ 128자 | 사용자ID | |||
| count | long | ✓ | 0 ~ 9223372036854775805 | 횟수 그룹화 조건에 일치하는 액세스 로그 엔트리의 총 수입니다. |
IssueStampSheetLog
트랜잭션 발행 로그
분산 트랜잭션의 발행을 기록합니다. 각 엔트리는 발행 시점에 하나의 트랜잭션으로 묶인 입수 액션과 관련된 소비 액션(태스크)을 캡처합니다.
상세
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |
|---|---|---|---|---|---|---|
| timestamp | long | ✓ | 일시 트랜잭션이 발행된 일시입니다. | |||
| transactionId | string | ✓ | ~ 1024자 | 트랜잭션 ID 발행된 분산 트랜잭션의 고유 식별자입니다. | ||
| service | string | ✓ | ~ 1024자 | 마이크로서비스 종류 트랜잭션을 발행한 GS2 마이크로서비스의 이름입니다. | ||
| method | string | ✓ | ~ 1024자 | 마이크로서비스 메서드 트랜잭션 발행을 트리거한 구체적인 API 메서드입니다. | ||
| userId | string | ✓ | ~ 128자 | 사용자ID | ||
| action | string | ✓ | ~ 1024자 | 입수 액션 트랜잭션에 포함된 입수 액션으로, 실행 시 사용자가 받게 되는 내용을 지정합니다. | ||
| args | string | ✓ | ~ 5242880자 | 인수 입수 액션의 파라미터(JSON 형식)입니다. | ||
| tasks | List<string> | 0 ~ 10 items | 소비 액션 목록 이 트랜잭션에 번들된 소비 액션 목록입니다. 입수 액션 이전에 실행되어 전제 조건으로 리소스를 소비합니다. |
IssueStampSheetLogCount
트랜잭션 발행 로그 집계
마이크로서비스 종류, 메서드, 사용자, 액션별로 그룹화된 트랜잭션 발행 로그 엔트리의 집계 건수입니다. 각 서비스에서 발행된 분산 트랜잭션의 볼륨과 분포 분석에 사용됩니다.
상세
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |
|---|---|---|---|---|---|---|
| service | string | ~ 1024자 | 마이크로서비스 종류 트랜잭션을 발행한 GS2 마이크로서비스의 이름입니다. | |||
| method | string | ~ 1024자 | 마이크로서비스 메서드 트랜잭션 발행을 트리거한 API 메서드입니다. | |||
| userId | string | ~ 128자 | 사용자ID | |||
| action | string | ~ 1024자 | 입수 액션 발행된 트랜잭션에 포함된 입수 액션의 종류입니다. | |||
| count | long | ✓ | 0 ~ 9223372036854775805 | 횟수 그룹화 조건에 일치하는 트랜잭션 발행 로그 엔트리의 총 수입니다. |
ExecuteStampSheetLog
입수 액션 실행 로그
마이크로서비스별 트랜잭션 실행 내용 로그입니다.
상세
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |
|---|---|---|---|---|---|---|
| timestamp | long | ✓ | 일시 입수 액션이 실행된 일시입니다. | |||
| transactionId | string | ✓ | ~ 1024자 | 트랜잭션 ID 이 입수 액션이 속한 분산 트랜잭션의 고유 식별자입니다. | ||
| service | string | ✓ | ~ 1024자 | 마이크로서비스 종류 입수 액션을 실행한 GS2 마이크로서비스의 이름입니다(예: inventory, experience). | ||
| method | string | ✓ | ~ 1024자 | 마이크로서비스 메서드 입수 액션 실행을 위해 마이크로서비스에서 호출된 구체적인 메서드입니다. | ||
| userId | string | ✓ | ~ 128자 | 사용자ID | ||
| action | string | ✓ | ~ 1024자 | 입수 액션 실행된 입수 액션의 종류입니다(예: Gs2Inventory:AcquireItemSetByUserId, Gs2Experience:AddExperienceByUserId). | ||
| args | string | ✓ | ~ 5242880자 | 인수 입수 액션에 전달된 파라미터(JSON 형식)입니다. |
ExecuteStampSheetLogCount
입수 액션 실행 로그 집계
마이크로서비스 종류, 메서드, 사용자, 액션별로 그룹화된 입수 액션 실행 로그 엔트리의 집계 건수입니다. 각종 입수 액션의 실행 빈도 분석에 사용됩니다.
상세
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |
|---|---|---|---|---|---|---|
| service | string | ~ 1024자 | 마이크로서비스 종류 입수 액션을 실행한 GS2 마이크로서비스의 이름입니다. | |||
| method | string | ~ 1024자 | 마이크로서비스 메서드 입수 액션 실행을 위해 호출된 구체적인 메서드입니다. | |||
| userId | string | ~ 128자 | 사용자ID | |||
| action | string | ~ 1024자 | 입수 액션 실행된 입수 액션의 종류입니다. | |||
| count | long | ✓ | 0 ~ 9223372036854775805 | 횟수 그룹화 조건에 일치하는 입수 액션 실행 로그 엔트리의 총 수입니다. |
ExecuteStampTaskLog
소비 액션 실행 로그
마이크로서비스별 소비 액션의 실행 내용을 기록한 로그입니다.
상세
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |
|---|---|---|---|---|---|---|
| timestamp | long | ✓ | 일시 소비 액션이 실행된 일시입니다. | |||
| taskId | string | ✓ | ~ 1024자 | 태스크 ID 실행된 소비 액션의 고유 식별자입니다. | ||
| service | string | ✓ | ~ 1024자 | 마이크로서비스 종류 소비 액션을 실행한 GS2 마이크로서비스의 이름입니다(예: inventory, money). | ||
| method | string | ✓ | ~ 1024자 | 마이크로서비스의 메서드 소비 액션을 실행하기 위해 마이크로서비스에서 호출된 구체적인 메서드입니다. | ||
| userId | string | ✓ | ~ 128자 | 사용자ID | ||
| action | string | ✓ | ~ 1024자 | 소비 액션 실행된 소비 액션의 종류입니다(예: Gs2Inventory:ConsumeItemSetByUserId, Gs2Money:WithdrawByUserId). | ||
| args | string | ✓ | ~ 5242880자 | 인수 소비 액션에 전달된 파라미터(JSON 형식)입니다. |
ExecuteStampTaskLogCount
소비 액션 실행 로그 집계
마이크로서비스 종류, 메서드, 사용자, 액션별로 그룹화된 소비 액션 실행 로그 항목의 집계 건수입니다. 각종 소비 액션의 실행 빈도 분석에 사용됩니다.
상세
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |
|---|---|---|---|---|---|---|
| service | string | ~ 1024자 | 마이크로서비스 종류 소비 액션을 실행한 GS2 마이크로서비스의 이름입니다. | |||
| method | string | ~ 1024자 | 마이크로서비스의 메서드 소비 액션을 실행하기 위해 호출된 구체적인 메서드입니다. | |||
| userId | string | ~ 128자 | 사용자ID | |||
| action | string | ~ 1024자 | 소비 액션 실행된 소비 액션의 종류입니다. | |||
| count | long | ✓ | 0 ~ 9223372036854775805 | 횟수 그룹화 조건에 일치하는 소비 액션 실행 로그 항목의 총 수입니다. |
InGameLog
인게임 로그
게임 클라이언트 또는 서버 사이드 스크립트에서 전송되는 커스텀 로그 엔트리입니다. GS2 API 호출로 자동 생성되는 액세스 로그와 달리, 인게임 로그는 게임 개발자가 플레이어의 행동, 게임 상태 변화, 비즈니스 메트릭 등 게임 고유의 이벤트를 기록하기 위해 명시적으로 전송합니다.
상세
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |
|---|---|---|---|---|---|---|
| timestamp | long | ✓ | 일시 인게임 로그가 전송된 일시입니다. | |||
| requestId | string | ✓ | ~ 1024자 | 요청 ID 중복 제거와 추적을 위해 이 로그 엔트리에 할당된 고유 식별자입니다. | ||
| userId | string | ~ 128자 | 사용자ID | |||
| tags | List<InGameLogTag> | [] | 0 ~ 20 items | 태그 필터링과 분류를 위해 로그 엔트리에 부여된 키-값 쌍입니다. 태그를 통해 인게임 로그의 효율적인 검색과 집계가 가능합니다(예: 이벤트 타입, 스테이지 ID, 아이템 카테고리). | ||
| payload | string | ✓ | ~ 10485760자 | 페이로드 JSON 형식의 커스텀 로그 데이터입니다. 플레이어의 행동, 게임 상태, 비즈니스 메트릭 등 게임 고유의 임의의 정보를 포함할 수 있습니다. 최대 10MB까지 가능합니다. |
AccessLogWithTelemetry
텔레메트리 정보가 포함된 액세스 로그
마이크로서비스에 대한 요청 및 응답 내용을 기록한 로그에 응답 시간과 호출자의 컨텍스트 정보를 추가한 로그입니다.
상세
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| timestamp | long | ✓ | 일시 API 요청이 처리된 일시입니다. | |||||||||
| sourceRequestId | string | ✓ | ~ 1024자 | 호출자 요청 ID 이 요청을 발생시킨 최초 호출자의 요청 ID입니다. 관련된 API 호출을 원래 요청까지 거슬러 추적하는 데 사용됩니다. | ||||||||
| requestId | string | ✓ | ~ 1024자 | 요청 ID 이 특정 API 요청에 할당된 고유 식별자입니다. | ||||||||
| duration | long | ✓ | 0 ~ 9223372036854775805 | 실행 시간 (ms) 이 API 요청을 수신하고 나서 응답까지 처리하는 데 걸린 시간(밀리초)입니다. | ||||||||
| service | string | ✓ | ~ 1024자 | 마이크로서비스 종류 요청을 처리한 GS2 마이크로서비스의 이름입니다(예: account, inventory, limit). | ||||||||
| method | string | ✓ | ~ 1024자 | 마이크로서비스 메서드 마이크로서비스에서 호출된 구체적인 API 메서드입니다(예: createNamespace, getItem). | ||||||||
| userId | string | ~ 128자 | 사용자ID | |||||||||
| request | string | ✓ | ~ 10485760자 | 요청 파라미터 API에 전송된 요청 파라미터의 전체 내용(JSON 형식)입니다. | ||||||||
| result | string | ✓ | ~ 10485760자 | 응답 내용 API에서 반환된 응답의 전체 내용(JSON 형식)입니다. | ||||||||
| status | 문자열 열거형 enum { “ok”, “error” } | ✓ | 상태 API 요청의 결과 상태입니다. “ok"는 정상 처리를 나타내고, “error"는 오류가 발생했음을 나타냅니다.
|
Insight
GS2-Insight는 GS2-Log에 축적된 액세스 로그를 시각화·분석하는 도구입니다.
GS2-Insight 자체는 오픈소스로 github에 공개되어 있습니다.
https://github.com/gs2io/gs2-insight
여기서는 공개된 오픈소스 코드를 직접 호스팅하지 않고도 온디맨드로 실행하여 이용하실 수 있습니다.
온디맨드로 실행된 GS2-Insight는 최대 2시간 이용할 수 있습니다.
2시간을 초과하여 이용하고 싶은 경우, 직접 호스팅하여 이용해 주세요.
상세
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| insightId | string | ※ | ~ 1024자 | GS2-Insight GRN
※ 서버가 자동으로 설정 | ||||||||||||
| name | string | ✓ | UUID | ~ 36자 | 이름 | |||||||||||
| taskId | string | ~ 128자 | 태스크 ID | |||||||||||||
| host | string | ~ 256자 | 호스트 이름 | |||||||||||||
| password | string | ✓ | ~ 32자 | 비밀번호 | ||||||||||||
| status | 문자열 열거형 enum { “ALLOCATING”, “LAUNCHING”, “ACTIVE”, “DELETED” } | “ALLOCATING” | 상태
| |||||||||||||
| createdAt | long | ※ | 현재 시각 | 생성일시 UNIX 시간·밀리초 ※ 서버가 자동으로 설정 | ||||||||||||
| revision | long | 0 | 0 ~ 9223372036854775805 | 리비전 |
Dashboard
대시보드
로그 데이터와 메트릭을 시각화하기 위한 커스터마이즈 가능한 대시보드입니다. 각 대시보드는 레이아웃과 위젯 설정을 JSON 페이로드로 저장하여, 로그 분석의 맞춤형 뷰를 만들 수 있습니다.
상세
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |
|---|---|---|---|---|---|---|
| dashboardId | string | ※ | ~ 1024자 | Dashboard GRN
※ 서버가 자동으로 설정 | ||
| name | string | ✓ | UUID | ~ 36자 | 대시보드 이름 | |
| displayName | string | ✓ | ~ 256자 | 표시용 이름 이 대시보드의 사람이 읽기 쉬운 이름으로, 대시보드 목록과 헤더에 표시됩니다. | ||
| description | string | ~ 1024자 | 설명문 | |||
| payload | string | ✓ | ~ 1048576자 | 페이로드 위젯 정의, 레이아웃 정보, 쿼리 설정, 시각화 옵션을 포함하는 JSON 형식의 대시보드 설정입니다. | ||
| createdAt | long | ※ | 현재 시각 | 생성일시 UNIX 시간·밀리초 ※ 서버가 자동으로 설정 | ||
| updatedAt | long | ※ | 현재 시각 | 최종 갱신일시 UNIX 시간·밀리초 ※ 서버가 자동으로 설정 |
FacetModel
패싯 모델
로그 데이터의 필터링과 집계에 사용할 수 있는 패싯 필드를 정의합니다. 패싯을 통해 서비스 이름, 메서드, 상태, 커스텀 필드 등 특정 차원으로 로그 검색 결과를 좁힐 수 있습니다.
상세
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| facetModelId | string | ※ | ~ 1024자 | Facet Model GRN
※ 서버가 자동으로 설정 | ||||||||||
| field | string | ✓ | ~ 128자 | 패싯 필드 이름 이 패싯이 대상으로 하는 로그 필드의 이름입니다(예: “service”, “method”, “status”). | ||||||||||
| type | 문자열 열거형 enum { “string”, “double”, “measure” } | ✓ | 패싯 데이터 타입 패싯 필드의 데이터 타입입니다. “string"은 값 카운트가 있는 범주형 값에, “double"은 범위 필터링이 있는 숫자 값에, “measure"는 통계 분석이 있는 측정값에 사용됩니다.
| |||||||||||
| displayName | string | ✓ | ~ 128자 | 표시용 이름 이 패싯의 사람이 읽을 수 있는 이름으로, 로그 검색 UI에 표시됩니다. | ||||||||||
| order | int | 0 | 0 ~ 100000 | 표시 순서 UI에서 이 패싯을 표시할 때의 정렬 순서입니다. 값이 작을수록 먼저 표시됩니다. |
MetricModel
메트릭 모델
모니터링 및 시각화할 수 있는 메트릭을 정의합니다. 사전 정의된 메트릭에는 각 GS2 마이크로서비스의 요청 수, 요청 시간, 에러율(4xx/5xx)이 포함됩니다. 각 메트릭에는 그룹화와 필터링을 위한 관련 라벨이 있습니다.
상세
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| name | string | ✓ | ~ 128자 | 메트릭 이름 이 메트릭의 고유 식별자입니다(예: “RequestCount”, “RequestDuration”, “Error4xxCount”, “Error5xxCount”). 서비스 고유 메트릭에는 서비스 이름이 접두사로 붙습니다. | ||||||||||
| type | 문자열 열거형 enum { “string”, “double”, “measure” } | ✓ | 메트릭 데이터 타입 메트릭 값의 데이터 타입입니다. “double"은 숫자 카운트에 사용되고, “measure"는 시간/지연 시간 측정에 사용됩니다.
| |||||||||||
| labels | List<string> | [] | 0 ~ 10 items | 라벨 이 메트릭에 연결된 라벨 이름으로, 메트릭 데이터의 그룹화와 필터링에 사용됩니다(예: “service”, “method”, “namespaceName”). 라벨은 메트릭을 분해할 수 있는 차원을 정의합니다. |
AggregationConfig
집계 설정
시계열 데이터를 조회할 때 로그 데이터 또는 메트릭의 집계 방법에 대한 설정입니다. 집계 함수(카운트, 평균, 백분위수 등)와 집계 대상 필드를 지정합니다.
상세
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| type | 문자열 열거형 enum { “count”, “unique”, “sum”, “avg”, “max”, “min”, “p90”, “p95”, “p99” } | “count” | 집계 타입: - unique: 고유 값의 수- avg: 평균값- max: 최댓값- min: 최솟값- p90: 90 백분위수- p99: 99 백분위수
| |||||||||||||||||||||||
| field | string | ~ 128자 | 집계 대상 필드(count 이외의 경우 필수) |
Facet
패싯
로그 데이터에 대한 패싯 쿼리의 결과로, 특정 필드 값의 분포를 포함합니다. 문자열 필드의 경우 값의 카운트를, 숫자 필드의 경우 현재 필터 조건에서의 값 범위와 UI 슬라이더 표시용 전역 범위를 제공합니다.
상세
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |
|---|---|---|---|---|---|---|
| field | string | ✓ | ~ 128자 | 패싯 필드 이름 | ||
| values | List<FacetValueCount> | [] | 0 ~ 100 items | 문자열 패싯의 값과 카운트 배열 | ||
| range | NumericRange | 현재 필터 조건에서의 숫자 범위 | ||||
| globalRange | NumericRange | 필터 적용 전 전체 데이터 범위(UI 슬라이더 범위에 사용) |
FacetValueCount
패싯 값 카운트
문자열 패싯 결과 내의 단일 값과 그 출현 횟수입니다. 특정 패싯 필드에 대해 몇 개의 로그 항목이 해당 값을 가지고 있는지를 나타냅니다.
상세
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |
|---|---|---|---|---|---|---|
| value | string | ✓ | ~ 256자 | 패싯 값 | ||
| count | long | ✓ | 0 ~ 9223372036854775805 | 이 값을 가진 로그의 건수 |
Label
라벨
분류, 필터링, 그룹화를 위해 로그 항목이나 메트릭에 부여되는 키-값 쌍입니다.
상세
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |
|---|---|---|---|---|---|---|
| key | string | ✓ | ~ 128자 | 라벨의 키 이 라벨의 키 이름입니다(예: “service”, “method”, “namespaceName”). | ||
| value | string | ✓ | ~ 256자 | 라벨의 값 키에 대응하는 이 라벨의 값입니다. |
LogEntry
로그 엔트리
트레이스 내의 단일 로그 레코드로, 하나의 처리 단계 또는 API 호출을 나타냅니다. 원본 로그 데이터, 처리 시간, 중요도 상태, 분류를 위한 관련 라벨을 포함합니다.
상세
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| timestamp | long | ✓ | 타임스탬프 이 로그 엔트리가 기록된 일시입니다. | |||||||||||||||||
| status | 문자열 열거형 enum { “ok”, “info”, “notice”, “error”, “warn”, “emag” } | ✓ | 상태 이 로그 엔트리의 중요도 수준으로, 정보 수준부터 긴급 수준까지 있습니다.
| |||||||||||||||||
| duration | long | 0 | 0 ~ 9223372036854775805 | 처리 시간(나노초) 이 로그 엔트리의 처리에 소요된 시간(나노초)입니다. | ||||||||||||||||
| line | string | ✓ | ~ 10485760자 | 로그 행 원본 데이터 JSON 형식의 원본 로그 데이터로, 요청/응답 정보를 포함한 처리 단계의 상세 내용 전체가 포함됩니다. | ||||||||||||||||
| labels | List<Label> | [] | 0 ~ 128 items | 라벨 분류와 필터링을 위해 이 로그 엔트리에 부여된 키-값 쌍입니다(예: 서비스 이름, 메서드, 요청 ID). |
NumericRange
숫자 범위.
range: 현재 필터 조건에서의 범위(다른 필터는 적용, 자기 자신은 제외)globalRange: 필터 적용 전 전체 데이터 범위(UI 슬라이더 범위에 사용)
상세
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |
|---|---|---|---|---|---|---|
| min | double | ✓ | 0 ~ 281474976710654 | 최솟값 | ||
| max | double | ✓ | 0 ~ 281474976710654 | 최댓값 |
TimeseriesMetadata
시계열 데이터 메타데이터
시계열 쿼리 결과에 관한 메타데이터로, 데이터에 포함된 시리즈 키와 그룹화에 사용된 필드를 나타냅니다. 클라이언트가 시계열 데이터를 올바르게 해석하고 표시하기 위해 사용됩니다.
상세
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |
|---|---|---|---|---|---|---|
| keys | List<string> | [] | 0 ~ 10 items | 데이터에 포함된 시리즈 키 목록 | ||
| groupBy | List<string> | [] | 0 ~ 10 items | 그룹화에 사용된 필드 |
TimeseriesPoint
타임시리즈 포인트
타임시리즈에서 특정 타임스탬프의 집계값을 나타내는 단일 데이터 포인트입니다. 그룹화가 적용된 경우, 각각 서로 다른 그룹에 대응하는 하나 이상의 값을 포함합니다.
상세
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |
|---|---|---|---|---|---|---|
| timestamp | long | ✓ | 타임스탬프 | |||
| values | List<TimeseriesValue> | [] | 0 ~ 10000 items | 이 타임스탬프에서의 각 그룹의 값 |
TimeseriesValue
시계열 데이터 값
시계열 데이터 포인트 내 단일 집계 값으로, 그룹별로 키가 지정됩니다. 데이터가 그룹화된 경우(예: 서비스나 메서드별) 각 그룹은 고유한 값을 가지며, 그룹화되지 않은 경우 키는 “count"입니다.
상세
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |
|---|---|---|---|---|---|---|
| key | string | ✓ | ~ 256자 | 그룹 키(그룹화하지 않은 경우 "count") | ||
| value | double | ✓ | 0 ~ 281474976710654 | 집계 값 |
Trace
트레이스
마이크로서비스 호출에 걸친 관련 로그 엔트리(스팬)를 하나의 요청 흐름으로 그룹화하는 분산 트레이스입니다. 사용자의 API 요청이 여러 GS2 마이크로서비스를 통해 어떻게 전파되는지를 엔드투엔드로 시각화할 수 있습니다.
상세
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |
|---|---|---|---|---|---|---|
| traceId | string | ✓ | UUID | ~ 36자 | 트레이스 ID 이 트레이스의 고유 식별자로, 요청 흐름 내의 모든 관련 로그 엔트리(스팬)에서 공유됩니다. | |
| spans | List<LogEntry> | [] | 0 ~ 100 items | 스팬 이 트레이스를 구성하는 로그 엔트리(스팬) 목록으로, 마이크로서비스 간 요청 흐름에서의 각 처리 단계를 나타냅니다. | ||
| truncated | bool | false | 잘림 스팬 목록이 엔트리의 최대 개수를 초과하여 잘렸는지 여부를 나타냅니다. true인 경우, 트레이스 내 일부 스팬이 응답에 포함되지 않습니다. |
InGameLogTag
게임 내 로그의 태그
인게임 로그 항목의 필터링과 분류에 사용되는 키-값 쌍입니다. 각 태그 키는 하나의 로그 항목 내에서 고유해야 합니다.
상세
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |
|---|---|---|---|---|---|---|
| key | string | ✓ | ~ 64자 | 태그 이름 이 태그의 키 이름입니다. 인게임 로그를 검색할 때 필터 조건으로 사용됩니다. | ||
| value | string | ✓ | ~ 128자 | 태그 값 이 태그의 값입니다. 키와 조합하여 특정 조건으로 로그를 필터링할 수 있습니다(예: key=“stageId”, value=“stage-001”). |
메서드
describeNamespaces
네임스페이스 목록 조회
프로젝트 내에서 서비스 단위로 생성된 네임스페이스의 목록을 조회합니다.
옵션인 페이지 토큰을 사용하여 목록의 특정 위치부터 데이터 조회를 시작할 수 있습니다.
또한 조회할 네임스페이스의 수를 제한하는 것도 가능합니다.
상세
Request
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |
|---|---|---|---|---|---|---|
| pageToken | string | ~ 1024자 | 데이터 취득을 시작할 위치를 지정하는 토큰 | |||
| limit | int | 30 | 1 ~ 1000 | 취득할 데이터 건수 |
Result
| 타입 | 설명 | |
|---|---|---|
| items | List<Namespace> | 네임스페이스 목록 |
| nextPageToken | string | 목록의 나머지를 취득하기 위한 페이지 토큰 |
구현 예제
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/log"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := log.Gs2LogRestClient{
Session: &session,
}
result, err := client.DescribeNamespaces(
&log.DescribeNamespacesRequest {
PageToken: nil,
Limit: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageTokenuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\DescribeNamespacesRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->describeNamespaces(
(new DescribeNamespacesRequest())
->withPageToken(null)
->withLimit(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.DescribeNamespacesRequest;
import io.gs2.log.result.DescribeNamespacesResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
DescribeNamespacesResult result = client.describeNamespaces(
new DescribeNamespacesRequest()
.withPageToken(null)
.withLimit(null)
);
List<Namespace> items = result.getItems();
String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.DescribeNamespacesResult> asyncResult = null;
yield return client.DescribeNamespaces(
new Gs2.Gs2Log.Request.DescribeNamespacesRequest()
.WithPageToken(null)
.WithLimit(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.describeNamespaces(
new Gs2Log.DescribeNamespacesRequest()
.withPageToken(null)
.withLimit(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.describe_namespaces(
log.DescribeNamespacesRequest()
.with_page_token(None)
.with_limit(None)
)
items = result.items
next_page_token = result.next_page_token
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.describe_namespaces({
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;client = gs2('log')
api_result_handler = client.describe_namespaces_async({
pageToken=nil,
limit=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;createNamespace
네임스페이스 신규 생성
네임스페이스의 이름, 설명 및 각종 설정을 포함한 상세 정보를 지정해야 합니다.
상세
Request
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| name | string | ✓ | ~ 128자 | 네임스페이스 이름 네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. | ||||||||||
| description | string | ~ 1024자 | 설명문 | |||||||||||
| type | 문자열 열거형 enum { “gs2”, “bigquery”, “firehose” } | “gs2” | 로그 출력 방법 로그 데이터의 내보내기 대상을 결정합니다. “gs2"는 GS2의 매니지드 스토리지에 로그를 저장하며 내장된 검색·분석 기능을 이용할 수 있습니다. “bigquery"는 Google BigQuery로 로그를 내보내 고급 분석을 수행할 수 있습니다. “firehose"는 Amazon Kinesis Data Firehose로 로그를 스트리밍하여 S3, Redshift 등의 AWS 대상으로 전달합니다.
| |||||||||||
| gcpCredentialJson | string | {type} == “bigquery” | ✓※ | ~ 5120자 | GCP 자격 증명 BigQuery로 로그를 내보낼 때 인증에 사용하는 GCP 자격 증명 JSON입니다. 서비스 계정에는 대상 데이터셋에 대한 BigQuery Data Editor 권한이 필요합니다. ※ type이(가) “bigquery” 이면 필수 | |||||||||
| bigQueryDatasetName | string | {type} == “bigquery” | ✓※ | ~ 1024자 | BigQuery 데이터셋 이름 로그 데이터를 내보낼 대상이 되는 BigQuery 데이터셋의 이름입니다. 데이터셋은 제공된 자격 증명에 연결된 GCP 프로젝트 내에 미리 존재해야 합니다. ※ type이(가) “bigquery” 이면 필수 | |||||||||
| logExpireDays | int | {type} in [“gs2”, “bigquery”] | ✓※ | 0 ~ 3650 | 로그 보존 기간(일) 로그 데이터를 보관하는 일수입니다. 이 기간을 초과한 로그는 자동으로 삭제됩니다. 내보내기 방법이 “gs2” 또는 “bigquery"인 경우에 적용됩니다. 최대 3650일(약 10년)까지 설정할 수 있습니다. ※ type이(가) “gs2”,“bigquery"이면 필수 | |||||||||
| awsRegion | string | {type} == “firehose” | ✓※ | ~ 256자 | AWS 리전 Kinesis Data Firehose 전송 스트림이 존재하는 AWS 리전입니다(예: us-east-1, ap-northeast-1). ※ type이(가) “firehose” 이면 필수 | |||||||||
| awsAccessKeyId | string | {type} == “firehose” | ✓※ | ~ 256자 | AWS 액세스 키 ID Kinesis Data Firehose 인증에 사용하는 AWS 액세스 키 ID입니다. IAM 사용자에게는 지정된 Firehose 전송 스트림으로 레코드를 전송할 수 있는 권한이 필요합니다. ※ type이(가) “firehose” 이면 필수 | |||||||||
| awsSecretAccessKey | string | {type} == “firehose” | ✓※ | ~ 256자 | AWS 시크릿 액세스 키 Kinesis Data Firehose 인증을 위해 액세스 키 ID와 짝을 이루는 AWS 시크릿 액세스 키입니다. ※ type이(가) “firehose” 이면 필수 | |||||||||
| firehoseStreamName | string | {type} == “firehose” | ✓※ | ~ 256자 | Kinesis Firehose 스트림 이름 로그 데이터의 전송 대상이 되는 Kinesis Data Firehose 전송 스트림의 이름입니다. ※ type이(가) “firehose” 이면 필수 | |||||||||
| firehoseCompressData | 문자열 열거형 enum { “none”, “gzip” } | {type} == “firehose” | “none” | Kinesis Firehose로 출력하는 데이터를 압축할지 여부 Kinesis Data Firehose로 전송하기 전에 로그 데이터를 압축할지를 설정합니다. Gzip 압축을 사용하면 데이터 전송량과 스토리지 비용을 절감할 수 있습니다.
※ type이(가) “firehose” 이면 필수 |
Result
| 타입 | 설명 | |
|---|---|---|
| item | Namespace | 생성한 네임스페이스 |
구현 예제
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/log"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := log.Gs2LogRestClient{
Session: &session,
}
result, err := client.CreateNamespace(
&log.CreateNamespaceRequest {
Name: pointy.String("namespace-0001"),
Description: nil,
Type: pointy.String("gs2"),
GcpCredentialJson: pointy.String("{\"project_id\": \"gs2-dev\"}"),
BigQueryDatasetName: pointy.String("dataset_0001"),
LogExpireDays: pointy.Int32(3),
AwsRegion: pointy.String("awsRegion"),
AwsAccessKeyId: pointy.String("awsAccessKeyId"),
AwsSecretAccessKey: pointy.String("awsSecretAccessKey"),
FirehoseStreamName: pointy.String("firehoseStreamName"),
FirehoseCompressData: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\CreateNamespaceRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->createNamespace(
(new CreateNamespaceRequest())
->withName("namespace-0001")
->withDescription(null)
->withType("gs2")
->withGcpCredentialJson("{\"project_id\": \"gs2-dev\"}")
->withBigQueryDatasetName("dataset_0001")
->withLogExpireDays(3)
->withAwsRegion("awsRegion")
->withAwsAccessKeyId("awsAccessKeyId")
->withAwsSecretAccessKey("awsSecretAccessKey")
->withFirehoseStreamName("firehoseStreamName")
->withFirehoseCompressData(null)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.CreateNamespaceRequest;
import io.gs2.log.result.CreateNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
CreateNamespaceResult result = client.createNamespace(
new CreateNamespaceRequest()
.withName("namespace-0001")
.withDescription(null)
.withType("gs2")
.withGcpCredentialJson("{\"project_id\": \"gs2-dev\"}")
.withBigQueryDatasetName("dataset_0001")
.withLogExpireDays(3)
.withAwsRegion("awsRegion")
.withAwsAccessKeyId("awsAccessKeyId")
.withAwsSecretAccessKey("awsSecretAccessKey")
.withFirehoseStreamName("firehoseStreamName")
.withFirehoseCompressData(null)
);
Namespace item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.CreateNamespaceResult> asyncResult = null;
yield return client.CreateNamespace(
new Gs2.Gs2Log.Request.CreateNamespaceRequest()
.WithName("namespace-0001")
.WithDescription(null)
.WithType("gs2")
.WithGcpCredentialJson("{\"project_id\": \"gs2-dev\"}")
.WithBigQueryDatasetName("dataset_0001")
.WithLogExpireDays(3)
.WithAwsRegion("awsRegion")
.WithAwsAccessKeyId("awsAccessKeyId")
.WithAwsSecretAccessKey("awsSecretAccessKey")
.WithFirehoseStreamName("firehoseStreamName")
.WithFirehoseCompressData(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.createNamespace(
new Gs2Log.CreateNamespaceRequest()
.withName("namespace-0001")
.withDescription(null)
.withType("gs2")
.withGcpCredentialJson("{\"project_id\": \"gs2-dev\"}")
.withBigQueryDatasetName("dataset_0001")
.withLogExpireDays(3)
.withAwsRegion("awsRegion")
.withAwsAccessKeyId("awsAccessKeyId")
.withAwsSecretAccessKey("awsSecretAccessKey")
.withFirehoseStreamName("firehoseStreamName")
.withFirehoseCompressData(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.create_namespace(
log.CreateNamespaceRequest()
.with_name('namespace-0001')
.with_description(None)
.with_type('gs2')
.with_gcp_credential_json('{"project_id": "gs2-dev"}')
.with_big_query_dataset_name('dataset_0001')
.with_log_expire_days(3)
.with_aws_region('awsRegion')
.with_aws_access_key_id('awsAccessKeyId')
.with_aws_secret_access_key('awsSecretAccessKey')
.with_firehose_stream_name('firehoseStreamName')
.with_firehose_compress_data(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.create_namespace({
name="namespace-0001",
description=nil,
type="gs2",
gcpCredentialJson="{\"project_id\": \"gs2-dev\"}",
bigQueryDatasetName="dataset_0001",
logExpireDays=3,
awsRegion="awsRegion",
awsAccessKeyId="awsAccessKeyId",
awsSecretAccessKey="awsSecretAccessKey",
firehoseStreamName="firehoseStreamName",
firehoseCompressData=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('log')
api_result_handler = client.create_namespace_async({
name="namespace-0001",
description=nil,
type="gs2",
gcpCredentialJson="{\"project_id\": \"gs2-dev\"}",
bigQueryDatasetName="dataset_0001",
logExpireDays=3,
awsRegion="awsRegion",
awsAccessKeyId="awsAccessKeyId",
awsSecretAccessKey="awsSecretAccessKey",
firehoseStreamName="firehoseStreamName",
firehoseCompressData=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;getNamespaceStatus
네임스페이스의 상태 조회
지정된 네임스페이스의 현재 상태를 조회합니다.
상태에는 네임스페이스가 활성 상태인지, 삭제되었는지가 포함됩니다.
상세
Request
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128자 | 네임스페이스 이름 네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
Result
| 타입 | 설명 | |||||||
|---|---|---|---|---|---|---|---|---|
| status | string | 네임스페이스의 상태
|
구현 예제
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/log"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := log.Gs2LogRestClient{
Session: &session,
}
result, err := client.GetNamespaceStatus(
&log.GetNamespaceStatusRequest {
NamespaceName: pointy.String("namespace-0001"),
}
)
if err != nil {
panic("error occurred")
}
status := result.Statususe Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\GetNamespaceStatusRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->getNamespaceStatus(
(new GetNamespaceStatusRequest())
->withNamespaceName("namespace-0001")
);
$status = $result->getStatus();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.GetNamespaceStatusRequest;
import io.gs2.log.result.GetNamespaceStatusResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
GetNamespaceStatusResult result = client.getNamespaceStatus(
new GetNamespaceStatusRequest()
.withNamespaceName("namespace-0001")
);
String status = result.getStatus();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.GetNamespaceStatusResult> asyncResult = null;
yield return client.GetNamespaceStatus(
new Gs2.Gs2Log.Request.GetNamespaceStatusRequest()
.WithNamespaceName("namespace-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var status = result.Status;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.getNamespaceStatus(
new Gs2Log.GetNamespaceStatusRequest()
.withNamespaceName("namespace-0001")
);
const status = result.getStatus();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.get_namespace_status(
log.GetNamespaceStatusRequest()
.with_namespace_name('namespace-0001')
)
status = result.status
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.get_namespace_status({
namespaceName="namespace-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
status = result.status;client = gs2('log')
api_result_handler = client.get_namespace_status_async({
namespaceName="namespace-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
status = result.status;getNamespace
네임스페이스 조회
지정된 네임스페이스의 상세 정보를 조회합니다.
여기에는 네임스페이스의 이름, 설명 및 기타 설정 정보가 포함됩니다.
상세
Request
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128자 | 네임스페이스 이름 네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
Result
| 타입 | 설명 | |
|---|---|---|
| item | Namespace | 네임스페이스 |
구현 예제
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/log"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := log.Gs2LogRestClient{
Session: &session,
}
result, err := client.GetNamespace(
&log.GetNamespaceRequest {
NamespaceName: pointy.String("namespace-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\GetNamespaceRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->getNamespace(
(new GetNamespaceRequest())
->withNamespaceName("namespace-0001")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.GetNamespaceRequest;
import io.gs2.log.result.GetNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
GetNamespaceResult result = client.getNamespace(
new GetNamespaceRequest()
.withNamespaceName("namespace-0001")
);
Namespace item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.GetNamespaceResult> asyncResult = null;
yield return client.GetNamespace(
new Gs2.Gs2Log.Request.GetNamespaceRequest()
.WithNamespaceName("namespace-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.getNamespace(
new Gs2Log.GetNamespaceRequest()
.withNamespaceName("namespace-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.get_namespace(
log.GetNamespaceRequest()
.with_namespace_name('namespace-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.get_namespace({
namespaceName="namespace-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('log')
api_result_handler = client.get_namespace_async({
namespaceName="namespace-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;updateNamespace
네임스페이스 갱신
지정된 네임스페이스의 설정을 갱신합니다.
네임스페이스의 설명이나 특정 설정을 변경할 수 있습니다.
상세
Request
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128자 | 네임스페이스 이름 네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. | ||||||||||
| description | string | ~ 1024자 | 설명문 | |||||||||||
| type | 문자열 열거형 enum { “gs2”, “bigquery”, “firehose” } | “gs2” | 로그 출력 방법 로그 데이터의 내보내기 대상을 결정합니다. “gs2"는 GS2의 매니지드 스토리지에 로그를 저장하며 내장된 검색·분석 기능을 이용할 수 있습니다. “bigquery"는 Google BigQuery로 로그를 내보내 고급 분석을 수행할 수 있습니다. “firehose"는 Amazon Kinesis Data Firehose로 로그를 스트리밍하여 S3, Redshift 등의 AWS 대상으로 전달합니다.
| |||||||||||
| gcpCredentialJson | string | {type} == “bigquery” | ✓※ | ~ 5120자 | GCP 자격 증명 BigQuery로 로그를 내보낼 때 인증에 사용하는 GCP 자격 증명 JSON입니다. 서비스 계정에는 대상 데이터셋에 대한 BigQuery Data Editor 권한이 필요합니다. ※ type이(가) “bigquery” 이면 필수 | |||||||||
| bigQueryDatasetName | string | {type} == “bigquery” | ✓※ | ~ 1024자 | BigQuery 데이터셋 이름 로그 데이터를 내보낼 대상이 되는 BigQuery 데이터셋의 이름입니다. 데이터셋은 제공된 자격 증명에 연결된 GCP 프로젝트 내에 미리 존재해야 합니다. ※ type이(가) “bigquery” 이면 필수 | |||||||||
| logExpireDays | int | {type} in [“gs2”, “bigquery”] | ✓※ | 0 ~ 3650 | 로그 보존 기간(일) 로그 데이터를 보관하는 일수입니다. 이 기간을 초과한 로그는 자동으로 삭제됩니다. 내보내기 방법이 “gs2” 또는 “bigquery"인 경우에 적용됩니다. 최대 3650일(약 10년)까지 설정할 수 있습니다. ※ type이(가) “gs2”,“bigquery"이면 필수 | |||||||||
| awsRegion | string | {type} == “firehose” | ✓※ | ~ 256자 | AWS 리전 Kinesis Data Firehose 전송 스트림이 존재하는 AWS 리전입니다(예: us-east-1, ap-northeast-1). ※ type이(가) “firehose” 이면 필수 | |||||||||
| awsAccessKeyId | string | {type} == “firehose” | ✓※ | ~ 256자 | AWS 액세스 키 ID Kinesis Data Firehose 인증에 사용하는 AWS 액세스 키 ID입니다. IAM 사용자에게는 지정된 Firehose 전송 스트림으로 레코드를 전송할 수 있는 권한이 필요합니다. ※ type이(가) “firehose” 이면 필수 | |||||||||
| awsSecretAccessKey | string | {type} == “firehose” | ✓※ | ~ 256자 | AWS 시크릿 액세스 키 Kinesis Data Firehose 인증을 위해 액세스 키 ID와 짝을 이루는 AWS 시크릿 액세스 키입니다. ※ type이(가) “firehose” 이면 필수 | |||||||||
| firehoseStreamName | string | {type} == “firehose” | ✓※ | ~ 256자 | Kinesis Firehose 스트림 이름 로그 데이터의 전송 대상이 되는 Kinesis Data Firehose 전송 스트림의 이름입니다. ※ type이(가) “firehose” 이면 필수 | |||||||||
| firehoseCompressData | 문자열 열거형 enum { “none”, “gzip” } | {type} == “firehose” | “none” | Kinesis Firehose로 출력하는 데이터를 압축할지 여부 Kinesis Data Firehose로 전송하기 전에 로그 데이터를 압축할지를 설정합니다. Gzip 압축을 사용하면 데이터 전송량과 스토리지 비용을 절감할 수 있습니다.
※ type이(가) “firehose” 이면 필수 |
Result
| 타입 | 설명 | |
|---|---|---|
| item | Namespace | 업데이트한 네임스페이스 |
구현 예제
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/log"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := log.Gs2LogRestClient{
Session: &session,
}
result, err := client.UpdateNamespace(
&log.UpdateNamespaceRequest {
NamespaceName: pointy.String("namespace-0001"),
Description: pointy.String("description1"),
Type: pointy.String("firehose"),
GcpCredentialJson: pointy.String("{\"project_id\": \"gs2-dev\"}"),
BigQueryDatasetName: pointy.String("dataset_0001"),
LogExpireDays: pointy.Int32(3),
AwsRegion: pointy.String("awsRegion"),
AwsAccessKeyId: pointy.String("awsAccessKeyId"),
AwsSecretAccessKey: pointy.String("awsSecretAccessKey"),
FirehoseStreamName: pointy.String("firehoseStreamName"),
FirehoseCompressData: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\UpdateNamespaceRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->updateNamespace(
(new UpdateNamespaceRequest())
->withNamespaceName("namespace-0001")
->withDescription("description1")
->withType("firehose")
->withGcpCredentialJson("{\"project_id\": \"gs2-dev\"}")
->withBigQueryDatasetName("dataset_0001")
->withLogExpireDays(3)
->withAwsRegion("awsRegion")
->withAwsAccessKeyId("awsAccessKeyId")
->withAwsSecretAccessKey("awsSecretAccessKey")
->withFirehoseStreamName("firehoseStreamName")
->withFirehoseCompressData(null)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.UpdateNamespaceRequest;
import io.gs2.log.result.UpdateNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
UpdateNamespaceResult result = client.updateNamespace(
new UpdateNamespaceRequest()
.withNamespaceName("namespace-0001")
.withDescription("description1")
.withType("firehose")
.withGcpCredentialJson("{\"project_id\": \"gs2-dev\"}")
.withBigQueryDatasetName("dataset_0001")
.withLogExpireDays(3)
.withAwsRegion("awsRegion")
.withAwsAccessKeyId("awsAccessKeyId")
.withAwsSecretAccessKey("awsSecretAccessKey")
.withFirehoseStreamName("firehoseStreamName")
.withFirehoseCompressData(null)
);
Namespace item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.UpdateNamespaceResult> asyncResult = null;
yield return client.UpdateNamespace(
new Gs2.Gs2Log.Request.UpdateNamespaceRequest()
.WithNamespaceName("namespace-0001")
.WithDescription("description1")
.WithType("firehose")
.WithGcpCredentialJson("{\"project_id\": \"gs2-dev\"}")
.WithBigQueryDatasetName("dataset_0001")
.WithLogExpireDays(3)
.WithAwsRegion("awsRegion")
.WithAwsAccessKeyId("awsAccessKeyId")
.WithAwsSecretAccessKey("awsSecretAccessKey")
.WithFirehoseStreamName("firehoseStreamName")
.WithFirehoseCompressData(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.updateNamespace(
new Gs2Log.UpdateNamespaceRequest()
.withNamespaceName("namespace-0001")
.withDescription("description1")
.withType("firehose")
.withGcpCredentialJson("{\"project_id\": \"gs2-dev\"}")
.withBigQueryDatasetName("dataset_0001")
.withLogExpireDays(3)
.withAwsRegion("awsRegion")
.withAwsAccessKeyId("awsAccessKeyId")
.withAwsSecretAccessKey("awsSecretAccessKey")
.withFirehoseStreamName("firehoseStreamName")
.withFirehoseCompressData(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.update_namespace(
log.UpdateNamespaceRequest()
.with_namespace_name('namespace-0001')
.with_description('description1')
.with_type('firehose')
.with_gcp_credential_json('{"project_id": "gs2-dev"}')
.with_big_query_dataset_name('dataset_0001')
.with_log_expire_days(3)
.with_aws_region('awsRegion')
.with_aws_access_key_id('awsAccessKeyId')
.with_aws_secret_access_key('awsSecretAccessKey')
.with_firehose_stream_name('firehoseStreamName')
.with_firehose_compress_data(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.update_namespace({
namespaceName="namespace-0001",
description="description1",
type="firehose",
gcpCredentialJson="{\"project_id\": \"gs2-dev\"}",
bigQueryDatasetName="dataset_0001",
logExpireDays=3,
awsRegion="awsRegion",
awsAccessKeyId="awsAccessKeyId",
awsSecretAccessKey="awsSecretAccessKey",
firehoseStreamName="firehoseStreamName",
firehoseCompressData=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('log')
api_result_handler = client.update_namespace_async({
namespaceName="namespace-0001",
description="description1",
type="firehose",
gcpCredentialJson="{\"project_id\": \"gs2-dev\"}",
bigQueryDatasetName="dataset_0001",
logExpireDays=3,
awsRegion="awsRegion",
awsAccessKeyId="awsAccessKeyId",
awsSecretAccessKey="awsSecretAccessKey",
firehoseStreamName="firehoseStreamName",
firehoseCompressData=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;deleteNamespace
네임스페이스 삭제
지정된 네임스페이스를 삭제합니다.
이 작업은 되돌릴 수 없으며, 삭제된 네임스페이스와 관련된 모든 데이터는 복구할 수 없게 됩니다.
상세
Request
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128자 | 네임스페이스 이름 네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
Result
| 타입 | 설명 | |
|---|---|---|
| item | Namespace | 삭제한 네임스페이스 |
구현 예제
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/log"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := log.Gs2LogRestClient{
Session: &session,
}
result, err := client.DeleteNamespace(
&log.DeleteNamespaceRequest {
NamespaceName: pointy.String("namespace-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\DeleteNamespaceRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->deleteNamespace(
(new DeleteNamespaceRequest())
->withNamespaceName("namespace-0001")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.DeleteNamespaceRequest;
import io.gs2.log.result.DeleteNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
DeleteNamespaceResult result = client.deleteNamespace(
new DeleteNamespaceRequest()
.withNamespaceName("namespace-0001")
);
Namespace item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.DeleteNamespaceResult> asyncResult = null;
yield return client.DeleteNamespace(
new Gs2.Gs2Log.Request.DeleteNamespaceRequest()
.WithNamespaceName("namespace-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.deleteNamespace(
new Gs2Log.DeleteNamespaceRequest()
.withNamespaceName("namespace-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.delete_namespace(
log.DeleteNamespaceRequest()
.with_namespace_name('namespace-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.delete_namespace({
namespaceName="namespace-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('log')
api_result_handler = client.delete_namespace_async({
namespaceName="namespace-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;getServiceVersion
마이크로서비스 버전 조회
상세
Request
요청 파라미터: 없음
Result
| 타입 | 설명 | |
|---|---|---|
| item | string | 버전 |
구현 예제
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/log"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := log.Gs2LogRestClient{
Session: &session,
}
result, err := client.GetServiceVersion(
&log.GetServiceVersionRequest {
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\GetServiceVersionRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->getServiceVersion(
(new GetServiceVersionRequest())
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.GetServiceVersionRequest;
import io.gs2.log.result.GetServiceVersionResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
GetServiceVersionResult result = client.getServiceVersion(
new GetServiceVersionRequest()
);
String item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.GetServiceVersionResult> asyncResult = null;
yield return client.GetServiceVersion(
new Gs2.Gs2Log.Request.GetServiceVersionRequest(),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.getServiceVersion(
new Gs2Log.GetServiceVersionRequest()
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.get_service_version(
log.GetServiceVersionRequest()
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.get_service_version({
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('log')
api_result_handler = client.get_service_version_async({
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;queryAccessLog
액세스 로그 목록 조회
지정된 시간 범위 내의 액세스 로그를 쿼리합니다. 서비스, 메서드, 사용자 ID로 필터링할 수 있습니다.
결과에는 총 건수와 스캔 크기(바이트)가 포함됩니다. 7일을 초과하는 기간을 검색하는 경우 longTerm 플래그를 활성화해야 하며, 스캔 용량 증가로 인해 API 실행 요금이 증가할 수 있습니다.
상세
Request
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128자 | 네임스페이스 이름 네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. | ||
| service | string | ~ 1024자 | 마이크로서비스 종류 요청을 처리한 GS2 마이크로서비스의 이름입니다(예: account, inventory, limit). | |||
| method | string | ~ 1024자 | 마이크로서비스 메서드 마이크로서비스에서 호출된 구체적인 API 메서드입니다(예: createNamespace, getItem). | |||
| userId | string | ~ 128자 | 사용자ID | |||
| begin | long | 현재 시각으로부터 1시간 전의 절대 시각 | 검색 범위 시작 일시 | |||
| end | long | 현재 시각 | 검색 범위 종료 일시 | |||
| longTerm | bool | false | 7일보다 긴 기간의 로그를 검색 대상으로 할지 여부 | |||
| pageToken | string | ~ 1024자 | 데이터 취득을 시작할 위치를 지정하는 토큰 | |||
| limit | int | 30 | 1 ~ 100 | 취득할 데이터 건수 | ||
| timeOffsetToken | string | ~ 1024자 | 타임 오프셋 토큰 |
Result
| 타입 | 설명 | |
|---|---|---|
| items | List<AccessLog> | 액세스 로그 목록 |
| nextPageToken | string | 목록의 나머지를 취득하기 위한 페이지 토큰 |
| totalCount | long | 쿼리 결과의 총 건수 |
| scanSize | long | 검색 시 스캔한 총 용량(bytes) |
구현 예제
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/log"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := log.Gs2LogRestClient{
Session: &session,
}
result, err := client.QueryAccessLog(
&log.QueryAccessLogRequest {
NamespaceName: pointy.String("namespace-0001"),
Service: pointy.String("account"),
Method: pointy.String("createAccount"),
UserId: pointy.String("user-0001"),
Begin: pointy.Int64(1473174000000),
End: pointy.Int64(1473177600000),
LongTerm: pointy.Bool(false),
PageToken: nil,
Limit: nil,
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
totalCount := result.TotalCount
scanSize := result.ScanSizeuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\QueryAccessLogRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->queryAccessLog(
(new QueryAccessLogRequest())
->withNamespaceName("namespace-0001")
->withService("account")
->withMethod("createAccount")
->withUserId("user-0001")
->withBegin(1473174000000)
->withEnd(1473177600000)
->withLongTerm(false)
->withPageToken(null)
->withLimit(null)
->withTimeOffsetToken(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
$totalCount = $result->getTotalCount();
$scanSize = $result->getScanSize();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.QueryAccessLogRequest;
import io.gs2.log.result.QueryAccessLogResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
QueryAccessLogResult result = client.queryAccessLog(
new QueryAccessLogRequest()
.withNamespaceName("namespace-0001")
.withService("account")
.withMethod("createAccount")
.withUserId("user-0001")
.withBegin(1473174000000L)
.withEnd(1473177600000L)
.withLongTerm(false)
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(null)
);
List<AccessLog> items = result.getItems();
String nextPageToken = result.getNextPageToken();
long totalCount = result.getTotalCount();
long scanSize = result.getScanSize();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.QueryAccessLogResult> asyncResult = null;
yield return client.QueryAccessLog(
new Gs2.Gs2Log.Request.QueryAccessLogRequest()
.WithNamespaceName("namespace-0001")
.WithService("account")
.WithMethod("createAccount")
.WithUserId("user-0001")
.WithBegin(1473174000000L)
.WithEnd(1473177600000L)
.WithLongTerm(false)
.WithPageToken(null)
.WithLimit(null)
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
var totalCount = result.TotalCount;
var scanSize = result.ScanSize;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.queryAccessLog(
new Gs2Log.QueryAccessLogRequest()
.withNamespaceName("namespace-0001")
.withService("account")
.withMethod("createAccount")
.withUserId("user-0001")
.withBegin(1473174000000)
.withEnd(1473177600000)
.withLongTerm(false)
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
const totalCount = result.getTotalCount();
const scanSize = result.getScanSize();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.query_access_log(
log.QueryAccessLogRequest()
.with_namespace_name('namespace-0001')
.with_service('account')
.with_method('createAccount')
.with_user_id('user-0001')
.with_begin(1473174000000)
.with_end(1473177600000)
.with_long_term(False)
.with_page_token(None)
.with_limit(None)
.with_time_offset_token(None)
)
items = result.items
next_page_token = result.next_page_token
total_count = result.total_count
scan_size = result.scan_size
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.query_access_log({
namespaceName="namespace-0001",
service="account",
method="createAccount",
userId="user-0001",
begin=1473174000000,
end=1473177600000,
longTerm=false,
pageToken=nil,
limit=nil,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
totalCount = result.totalCount;
scanSize = result.scanSize;client = gs2('log')
api_result_handler = client.query_access_log_async({
namespaceName="namespace-0001",
service="account",
method="createAccount",
userId="user-0001",
begin=1473174000000,
end=1473177600000,
longTerm=false,
pageToken=nil,
limit=nil,
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
totalCount = result.totalCount;
scanSize = result.scanSize;countAccessLog
액세스 로그의 집계 결과 조회
지정된 시간 범위 내의 액세스 로그 건수를 집계합니다. 서비스, 메서드, 사용자 ID로 분류할 수 있습니다.
각 분류 플래그에 따라 해당 차원으로 그룹화할지 여부가 제어됩니다. longTerm 플래그를 활성화하면 7일을 초과하는 기간도 검색할 수 있습니다.
상세
Request
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128자 | 네임스페이스 이름 네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. | ||
| service | bool | false | 마이크로서비스 종류로 분류할지 여부 | |||
| method | bool | false | 마이크로서비스 메서드로 분류할지 여부 | |||
| userId | bool | false | 사용자 ID로 분류할지 여부 | |||
| begin | long | 현재 시각으로부터 1시간 전의 절대 시각 | 검색 범위 시작 일시 | |||
| end | long | 현재 시각 | 검색 범위 종료 일시 | |||
| longTerm | bool | false | 7일보다 긴 기간의 로그를 검색 대상으로 할지 여부 | |||
| pageToken | string | ~ 1024자 | 데이터 취득을 시작할 위치를 지정하는 토큰 | |||
| limit | int | 30 | 1 ~ 1000 | 취득할 데이터 건수 | ||
| timeOffsetToken | string | ~ 1024자 | 타임 오프셋 토큰 |
Result
| 타입 | 설명 | |
|---|---|---|
| items | List<AccessLogCount> | 액세스 로그 집계 목록 |
| nextPageToken | string | 목록의 나머지를 취득하기 위한 페이지 토큰 |
| totalCount | long | 쿼리 결과의 총 건수 |
| scanSize | long | 검색 시 스캔한 총 용량(bytes) |
구현 예제
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/log"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := log.Gs2LogRestClient{
Session: &session,
}
result, err := client.CountAccessLog(
&log.CountAccessLogRequest {
NamespaceName: pointy.String("namespace-0001"),
Service: pointy.String("account"),
Method: pointy.String("createAccount"),
UserId: pointy.String("user-0001"),
Begin: pointy.Int64(1473174000000),
End: pointy.Int64(1473177600000),
LongTerm: pointy.Bool(false),
PageToken: nil,
Limit: nil,
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
totalCount := result.TotalCount
scanSize := result.ScanSizeuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\CountAccessLogRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->countAccessLog(
(new CountAccessLogRequest())
->withNamespaceName("namespace-0001")
->withService("account")
->withMethod("createAccount")
->withUserId("user-0001")
->withBegin(1473174000000)
->withEnd(1473177600000)
->withLongTerm(false)
->withPageToken(null)
->withLimit(null)
->withTimeOffsetToken(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
$totalCount = $result->getTotalCount();
$scanSize = $result->getScanSize();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.CountAccessLogRequest;
import io.gs2.log.result.CountAccessLogResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
CountAccessLogResult result = client.countAccessLog(
new CountAccessLogRequest()
.withNamespaceName("namespace-0001")
.withService("account")
.withMethod("createAccount")
.withUserId("user-0001")
.withBegin(1473174000000L)
.withEnd(1473177600000L)
.withLongTerm(false)
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(null)
);
List<AccessLogCount> items = result.getItems();
String nextPageToken = result.getNextPageToken();
long totalCount = result.getTotalCount();
long scanSize = result.getScanSize();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.CountAccessLogResult> asyncResult = null;
yield return client.CountAccessLog(
new Gs2.Gs2Log.Request.CountAccessLogRequest()
.WithNamespaceName("namespace-0001")
.WithService("account")
.WithMethod("createAccount")
.WithUserId("user-0001")
.WithBegin(1473174000000L)
.WithEnd(1473177600000L)
.WithLongTerm(false)
.WithPageToken(null)
.WithLimit(null)
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
var totalCount = result.TotalCount;
var scanSize = result.ScanSize;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.countAccessLog(
new Gs2Log.CountAccessLogRequest()
.withNamespaceName("namespace-0001")
.withService("account")
.withMethod("createAccount")
.withUserId("user-0001")
.withBegin(1473174000000)
.withEnd(1473177600000)
.withLongTerm(false)
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
const totalCount = result.getTotalCount();
const scanSize = result.getScanSize();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.count_access_log(
log.CountAccessLogRequest()
.with_namespace_name('namespace-0001')
.with_service('account')
.with_method('createAccount')
.with_user_id('user-0001')
.with_begin(1473174000000)
.with_end(1473177600000)
.with_long_term(False)
.with_page_token(None)
.with_limit(None)
.with_time_offset_token(None)
)
items = result.items
next_page_token = result.next_page_token
total_count = result.total_count
scan_size = result.scan_size
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.count_access_log({
namespaceName="namespace-0001",
service="account",
method="createAccount",
userId="user-0001",
begin=1473174000000,
end=1473177600000,
longTerm=false,
pageToken=nil,
limit=nil,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
totalCount = result.totalCount;
scanSize = result.scanSize;client = gs2('log')
api_result_handler = client.count_access_log_async({
namespaceName="namespace-0001",
service="account",
method="createAccount",
userId="user-0001",
begin=1473174000000,
end=1473177600000,
longTerm=false,
pageToken=nil,
limit=nil,
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
totalCount = result.totalCount;
scanSize = result.scanSize;queryIssueStampSheetLog
트랜잭션 발행 로그 목록 조회
지정된 시간 범위 내의 트랜잭션 발행 로그를 쿼리합니다.
서비스, 메서드, 사용자 ID, 액션 타입으로 필터링할 수 있습니다. 응답에는 총 건수와 스캔 크기가 포함됩니다. 7일을 초과하는 검색에는 longTerm 플래그를 활성화해야 합니다.
상세
Request
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128자 | 네임스페이스 이름 네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. | ||
| service | string | ~ 1024자 | 마이크로서비스 종류 트랜잭션을 발행한 GS2 마이크로서비스의 이름입니다. | |||
| method | string | ~ 1024자 | 마이크로서비스 메서드 트랜잭션 발행을 트리거한 구체적인 API 메서드입니다. | |||
| userId | string | ~ 128자 | 사용자ID | |||
| action | string | ~ 1024자 | 입수 액션 트랜잭션에 포함된 입수 액션으로, 실행 시 사용자가 받게 되는 내용을 지정합니다. | |||
| begin | long | 현재 시각으로부터 1시간 전의 절대 시각 | 검색 범위 시작 일시 | |||
| end | long | 현재 시각 | 검색 범위 종료 일시 | |||
| longTerm | bool | false | 7일보다 긴 기간의 로그를 검색 대상으로 할지 여부 | |||
| pageToken | string | ~ 1024자 | 데이터 취득을 시작할 위치를 지정하는 토큰 | |||
| limit | int | 30 | 1 ~ 100 | 취득할 데이터 건수 | ||
| timeOffsetToken | string | ~ 1024자 | 타임 오프셋 토큰 |
Result
| 타입 | 설명 | |
|---|---|---|
| items | List<IssueStampSheetLog> | 트랜잭션 발행 로그 목록 |
| nextPageToken | string | 목록의 나머지를 취득하기 위한 페이지 토큰 |
| totalCount | long | 쿼리 결과의 총 건수 |
| scanSize | long | 검색 시 스캔한 총 용량(bytes) |
구현 예제
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/log"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := log.Gs2LogRestClient{
Session: &session,
}
result, err := client.QueryIssueStampSheetLog(
&log.QueryIssueStampSheetLogRequest {
NamespaceName: pointy.String("namespace-0001"),
Service: pointy.String("showcase"),
Method: pointy.String("buy"),
UserId: pointy.String("user-0001"),
Action: pointy.String("Gs2Showcase:Buy"),
Begin: pointy.Int64(1473174000000),
End: pointy.Int64(1473177600000),
LongTerm: pointy.Bool(false),
PageToken: nil,
Limit: nil,
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
totalCount := result.TotalCount
scanSize := result.ScanSizeuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\QueryIssueStampSheetLogRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->queryIssueStampSheetLog(
(new QueryIssueStampSheetLogRequest())
->withNamespaceName("namespace-0001")
->withService("showcase")
->withMethod("buy")
->withUserId("user-0001")
->withAction("Gs2Showcase:Buy")
->withBegin(1473174000000)
->withEnd(1473177600000)
->withLongTerm(false)
->withPageToken(null)
->withLimit(null)
->withTimeOffsetToken(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
$totalCount = $result->getTotalCount();
$scanSize = $result->getScanSize();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.QueryIssueStampSheetLogRequest;
import io.gs2.log.result.QueryIssueStampSheetLogResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
QueryIssueStampSheetLogResult result = client.queryIssueStampSheetLog(
new QueryIssueStampSheetLogRequest()
.withNamespaceName("namespace-0001")
.withService("showcase")
.withMethod("buy")
.withUserId("user-0001")
.withAction("Gs2Showcase:Buy")
.withBegin(1473174000000L)
.withEnd(1473177600000L)
.withLongTerm(false)
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(null)
);
List<IssueStampSheetLog> items = result.getItems();
String nextPageToken = result.getNextPageToken();
long totalCount = result.getTotalCount();
long scanSize = result.getScanSize();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.QueryIssueStampSheetLogResult> asyncResult = null;
yield return client.QueryIssueStampSheetLog(
new Gs2.Gs2Log.Request.QueryIssueStampSheetLogRequest()
.WithNamespaceName("namespace-0001")
.WithService("showcase")
.WithMethod("buy")
.WithUserId("user-0001")
.WithAction("Gs2Showcase:Buy")
.WithBegin(1473174000000L)
.WithEnd(1473177600000L)
.WithLongTerm(false)
.WithPageToken(null)
.WithLimit(null)
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
var totalCount = result.TotalCount;
var scanSize = result.ScanSize;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.queryIssueStampSheetLog(
new Gs2Log.QueryIssueStampSheetLogRequest()
.withNamespaceName("namespace-0001")
.withService("showcase")
.withMethod("buy")
.withUserId("user-0001")
.withAction("Gs2Showcase:Buy")
.withBegin(1473174000000)
.withEnd(1473177600000)
.withLongTerm(false)
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
const totalCount = result.getTotalCount();
const scanSize = result.getScanSize();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.query_issue_stamp_sheet_log(
log.QueryIssueStampSheetLogRequest()
.with_namespace_name('namespace-0001')
.with_service('showcase')
.with_method('buy')
.with_user_id('user-0001')
.with_action('Gs2Showcase:Buy')
.with_begin(1473174000000)
.with_end(1473177600000)
.with_long_term(False)
.with_page_token(None)
.with_limit(None)
.with_time_offset_token(None)
)
items = result.items
next_page_token = result.next_page_token
total_count = result.total_count
scan_size = result.scan_size
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.query_issue_stamp_sheet_log({
namespaceName="namespace-0001",
service="showcase",
method="buy",
userId="user-0001",
action="Gs2Showcase:Buy",
begin=1473174000000,
end=1473177600000,
longTerm=false,
pageToken=nil,
limit=nil,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
totalCount = result.totalCount;
scanSize = result.scanSize;client = gs2('log')
api_result_handler = client.query_issue_stamp_sheet_log_async({
namespaceName="namespace-0001",
service="showcase",
method="buy",
userId="user-0001",
action="Gs2Showcase:Buy",
begin=1473174000000,
end=1473177600000,
longTerm=false,
pageToken=nil,
limit=nil,
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
totalCount = result.totalCount;
scanSize = result.scanSize;countIssueStampSheetLog
트랜잭션 발행 로그의 집계 결과 조회
지정된 시간 범위 내의 트랜잭션 발행 로그 건수를 집계합니다. 서비스, 메서드, 사용자 ID, 액션 타입으로 분류할 수 있습니다.
각 분류 플래그에 따라 해당 차원으로 그룹화할지 여부가 제어됩니다.
상세
Request
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128자 | 네임스페이스 이름 네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. | ||
| service | bool | false | 마이크로서비스 종류로 분류할지 여부 | |||
| method | bool | false | 마이크로서비스 메서드로 분류할지 여부 | |||
| userId | bool | false | 사용자 ID로 분류할지 여부 | |||
| action | bool | false | 획득 액션으로 분류할지 여부 | |||
| begin | long | 현재 시각으로부터 1시간 전의 절대 시각 | 검색 범위 시작 일시 | |||
| end | long | 현재 시각 | 검색 범위 종료 일시 | |||
| longTerm | bool | false | 7일보다 긴 기간의 로그를 검색 대상으로 할지 여부 | |||
| pageToken | string | ~ 1024자 | 데이터 취득을 시작할 위치를 지정하는 토큰 | |||
| limit | int | 30 | 1 ~ 1000 | 조회한 데이터 건수 | ||
| timeOffsetToken | string | ~ 1024자 | 타임 오프셋 토큰 |
Result
| 타입 | 설명 | |
|---|---|---|
| items | List<IssueStampSheetLogCount> | 트랜잭션 발행 로그 집계 목록 |
| nextPageToken | string | 목록의 나머지를 취득하기 위한 페이지 토큰 |
| totalCount | long | 쿼리 결과의 총 건수 |
| scanSize | long | 검색 시 스캔한 총 용량(bytes) |
구현 예제
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/log"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := log.Gs2LogRestClient{
Session: &session,
}
result, err := client.CountIssueStampSheetLog(
&log.CountIssueStampSheetLogRequest {
NamespaceName: pointy.String("namespace-0001"),
Service: pointy.String("showcase"),
Method: pointy.String("buy"),
UserId: pointy.String("user-0001"),
Action: pointy.String("Gs2Showcase:Buy"),
Begin: pointy.Int64(1473174000000),
End: pointy.Int64(1473177600000),
LongTerm: pointy.Bool(false),
PageToken: nil,
Limit: nil,
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
totalCount := result.TotalCount
scanSize := result.ScanSizeuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\CountIssueStampSheetLogRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->countIssueStampSheetLog(
(new CountIssueStampSheetLogRequest())
->withNamespaceName("namespace-0001")
->withService("showcase")
->withMethod("buy")
->withUserId("user-0001")
->withAction("Gs2Showcase:Buy")
->withBegin(1473174000000)
->withEnd(1473177600000)
->withLongTerm(false)
->withPageToken(null)
->withLimit(null)
->withTimeOffsetToken(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
$totalCount = $result->getTotalCount();
$scanSize = $result->getScanSize();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.CountIssueStampSheetLogRequest;
import io.gs2.log.result.CountIssueStampSheetLogResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
CountIssueStampSheetLogResult result = client.countIssueStampSheetLog(
new CountIssueStampSheetLogRequest()
.withNamespaceName("namespace-0001")
.withService("showcase")
.withMethod("buy")
.withUserId("user-0001")
.withAction("Gs2Showcase:Buy")
.withBegin(1473174000000L)
.withEnd(1473177600000L)
.withLongTerm(false)
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(null)
);
List<IssueStampSheetLogCount> items = result.getItems();
String nextPageToken = result.getNextPageToken();
long totalCount = result.getTotalCount();
long scanSize = result.getScanSize();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.CountIssueStampSheetLogResult> asyncResult = null;
yield return client.CountIssueStampSheetLog(
new Gs2.Gs2Log.Request.CountIssueStampSheetLogRequest()
.WithNamespaceName("namespace-0001")
.WithService("showcase")
.WithMethod("buy")
.WithUserId("user-0001")
.WithAction("Gs2Showcase:Buy")
.WithBegin(1473174000000L)
.WithEnd(1473177600000L)
.WithLongTerm(false)
.WithPageToken(null)
.WithLimit(null)
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
var totalCount = result.TotalCount;
var scanSize = result.ScanSize;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.countIssueStampSheetLog(
new Gs2Log.CountIssueStampSheetLogRequest()
.withNamespaceName("namespace-0001")
.withService("showcase")
.withMethod("buy")
.withUserId("user-0001")
.withAction("Gs2Showcase:Buy")
.withBegin(1473174000000)
.withEnd(1473177600000)
.withLongTerm(false)
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
const totalCount = result.getTotalCount();
const scanSize = result.getScanSize();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.count_issue_stamp_sheet_log(
log.CountIssueStampSheetLogRequest()
.with_namespace_name('namespace-0001')
.with_service('showcase')
.with_method('buy')
.with_user_id('user-0001')
.with_action('Gs2Showcase:Buy')
.with_begin(1473174000000)
.with_end(1473177600000)
.with_long_term(False)
.with_page_token(None)
.with_limit(None)
.with_time_offset_token(None)
)
items = result.items
next_page_token = result.next_page_token
total_count = result.total_count
scan_size = result.scan_size
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.count_issue_stamp_sheet_log({
namespaceName="namespace-0001",
service="showcase",
method="buy",
userId="user-0001",
action="Gs2Showcase:Buy",
begin=1473174000000,
end=1473177600000,
longTerm=false,
pageToken=nil,
limit=nil,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
totalCount = result.totalCount;
scanSize = result.scanSize;client = gs2('log')
api_result_handler = client.count_issue_stamp_sheet_log_async({
namespaceName="namespace-0001",
service="showcase",
method="buy",
userId="user-0001",
action="Gs2Showcase:Buy",
begin=1473174000000,
end=1473177600000,
longTerm=false,
pageToken=nil,
limit=nil,
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
totalCount = result.totalCount;
scanSize = result.scanSize;queryExecuteStampSheetLog
획득 액션 실행 로그 목록 조회
지정된 시간 범위 내의 획득 액션 실행 로그를 조회합니다.
서비스, 메서드, 사용자 ID, 액션 타입으로 필터링할 수 있습니다. 응답에는 총 건수와 스캔 크기가 포함됩니다. 7일을 초과하는 검색에는 longTerm 플래그를 활성화하세요.
상세
Request
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128자 | 네임스페이스 이름 네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. | ||
| service | string | ~ 1024자 | 마이크로서비스 종류 입수 액션을 실행한 GS2 마이크로서비스의 이름입니다(예: inventory, experience). | |||
| method | string | ~ 1024자 | 마이크로서비스 메서드 입수 액션 실행을 위해 마이크로서비스에서 호출된 구체적인 메서드입니다. | |||
| userId | string | ~ 128자 | 사용자ID | |||
| action | string | ~ 1024자 | 입수 액션 실행된 입수 액션의 종류입니다(예: Gs2Inventory:AcquireItemSetByUserId, Gs2Experience:AddExperienceByUserId). | |||
| begin | long | 현재 시각으로부터 1시간 전의 절대 시각 | 검색 범위 시작 일시 | |||
| end | long | 현재 시각 | 검색 범위 종료 일시 | |||
| longTerm | bool | false | 7일보다 긴 기간의 로그를 검색 대상으로 할지 여부 | |||
| pageToken | string | ~ 1024자 | 데이터 취득을 시작할 위치를 지정하는 토큰 | |||
| limit | int | 30 | 1 ~ 100 | 취득할 데이터 건수 | ||
| timeOffsetToken | string | ~ 1024자 | 타임 오프셋 토큰 |
Result
| 타입 | 설명 | |
|---|---|---|
| items | List<ExecuteStampSheetLog> | 획득 액션 실행 로그 목록 |
| nextPageToken | string | 목록의 나머지를 취득하기 위한 페이지 토큰 |
| totalCount | long | 쿼리 결과의 총 건수 |
| scanSize | long | 검색 시 스캔한 총 용량(bytes) |
구현 예제
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/log"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := log.Gs2LogRestClient{
Session: &session,
}
result, err := client.QueryExecuteStampSheetLog(
&log.QueryExecuteStampSheetLogRequest {
NamespaceName: pointy.String("namespace-0001"),
Service: pointy.String("inventory"),
Method: pointy.String("acquireItemSetByUserId"),
UserId: pointy.String("user-0001"),
Action: nil,
Begin: pointy.Int64(1473174000000),
End: pointy.Int64(1473177600000),
LongTerm: pointy.Bool(false),
PageToken: nil,
Limit: nil,
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
totalCount := result.TotalCount
scanSize := result.ScanSizeuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\QueryExecuteStampSheetLogRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->queryExecuteStampSheetLog(
(new QueryExecuteStampSheetLogRequest())
->withNamespaceName("namespace-0001")
->withService("inventory")
->withMethod("acquireItemSetByUserId")
->withUserId("user-0001")
->withAction(null)
->withBegin(1473174000000)
->withEnd(1473177600000)
->withLongTerm(false)
->withPageToken(null)
->withLimit(null)
->withTimeOffsetToken(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
$totalCount = $result->getTotalCount();
$scanSize = $result->getScanSize();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.QueryExecuteStampSheetLogRequest;
import io.gs2.log.result.QueryExecuteStampSheetLogResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
QueryExecuteStampSheetLogResult result = client.queryExecuteStampSheetLog(
new QueryExecuteStampSheetLogRequest()
.withNamespaceName("namespace-0001")
.withService("inventory")
.withMethod("acquireItemSetByUserId")
.withUserId("user-0001")
.withAction(null)
.withBegin(1473174000000L)
.withEnd(1473177600000L)
.withLongTerm(false)
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(null)
);
List<ExecuteStampSheetLog> items = result.getItems();
String nextPageToken = result.getNextPageToken();
long totalCount = result.getTotalCount();
long scanSize = result.getScanSize();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.QueryExecuteStampSheetLogResult> asyncResult = null;
yield return client.QueryExecuteStampSheetLog(
new Gs2.Gs2Log.Request.QueryExecuteStampSheetLogRequest()
.WithNamespaceName("namespace-0001")
.WithService("inventory")
.WithMethod("acquireItemSetByUserId")
.WithUserId("user-0001")
.WithAction(null)
.WithBegin(1473174000000L)
.WithEnd(1473177600000L)
.WithLongTerm(false)
.WithPageToken(null)
.WithLimit(null)
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
var totalCount = result.TotalCount;
var scanSize = result.ScanSize;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.queryExecuteStampSheetLog(
new Gs2Log.QueryExecuteStampSheetLogRequest()
.withNamespaceName("namespace-0001")
.withService("inventory")
.withMethod("acquireItemSetByUserId")
.withUserId("user-0001")
.withAction(null)
.withBegin(1473174000000)
.withEnd(1473177600000)
.withLongTerm(false)
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
const totalCount = result.getTotalCount();
const scanSize = result.getScanSize();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.query_execute_stamp_sheet_log(
log.QueryExecuteStampSheetLogRequest()
.with_namespace_name('namespace-0001')
.with_service('inventory')
.with_method('acquireItemSetByUserId')
.with_user_id('user-0001')
.with_action(None)
.with_begin(1473174000000)
.with_end(1473177600000)
.with_long_term(False)
.with_page_token(None)
.with_limit(None)
.with_time_offset_token(None)
)
items = result.items
next_page_token = result.next_page_token
total_count = result.total_count
scan_size = result.scan_size
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.query_execute_stamp_sheet_log({
namespaceName="namespace-0001",
service="inventory",
method="acquireItemSetByUserId",
userId="user-0001",
action=nil,
begin=1473174000000,
end=1473177600000,
longTerm=false,
pageToken=nil,
limit=nil,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
totalCount = result.totalCount;
scanSize = result.scanSize;client = gs2('log')
api_result_handler = client.query_execute_stamp_sheet_log_async({
namespaceName="namespace-0001",
service="inventory",
method="acquireItemSetByUserId",
userId="user-0001",
action=nil,
begin=1473174000000,
end=1473177600000,
longTerm=false,
pageToken=nil,
limit=nil,
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
totalCount = result.totalCount;
scanSize = result.scanSize;countExecuteStampSheetLog
획득 액션 실행 로그의 집계 결과를 조회
지정된 시간 범위 내의 획득 액션 실행 로그 건수를 집계합니다. 서비스, 메서드, 사용자 ID, 액션 타입으로 분류할 수 있습니다.
각 분류 플래그에 따라 해당 차원으로 그룹화할지가 제어됩니다.
상세
Request
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128자 | 네임스페이스 이름 네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. | ||
| service | bool | false | 마이크로서비스 종류로 분류할지 여부 | |||
| method | bool | false | 마이크로서비스 메서드로 분류할지 여부 | |||
| userId | bool | false | 사용자 ID로 분류할지 여부 | |||
| action | bool | false | 획득 액션으로 분류할지 여부 | |||
| begin | long | 현재 시각으로부터 1시간 전의 절대 시각 | 검색 범위 시작 일시 | |||
| end | long | 현재 시각 | 검색 범위 종료 일시 | |||
| longTerm | bool | false | 7일보다 긴 기간의 로그를 검색 대상으로 할지 여부 | |||
| pageToken | string | ~ 1024자 | 데이터 취득을 시작할 위치를 지정하는 토큰 | |||
| limit | int | 30 | 1 ~ 1000 | 취득할 데이터 건수 | ||
| timeOffsetToken | string | ~ 1024자 | 타임 오프셋 토큰 |
Result
| 타입 | 설명 | |
|---|---|---|
| items | List<ExecuteStampSheetLogCount> | 획득 액션 실행 로그 집계 목록 |
| nextPageToken | string | 목록의 나머지를 취득하기 위한 페이지 토큰 |
| totalCount | long | 쿼리 결과의 총 건수 |
| scanSize | long | 검색 시 스캔한 총 용량(bytes) |
구현 예제
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/log"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := log.Gs2LogRestClient{
Session: &session,
}
result, err := client.CountExecuteStampSheetLog(
&log.CountExecuteStampSheetLogRequest {
NamespaceName: pointy.String("namespace-0001"),
Service: pointy.String("inventory"),
Method: pointy.String("acquireItemSetByUserId"),
UserId: pointy.String("user-0001"),
Action: nil,
Begin: pointy.Int64(1473174000000),
End: pointy.Int64(1473177600000),
LongTerm: pointy.Bool(false),
PageToken: nil,
Limit: nil,
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
totalCount := result.TotalCount
scanSize := result.ScanSizeuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\CountExecuteStampSheetLogRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->countExecuteStampSheetLog(
(new CountExecuteStampSheetLogRequest())
->withNamespaceName("namespace-0001")
->withService("inventory")
->withMethod("acquireItemSetByUserId")
->withUserId("user-0001")
->withAction(null)
->withBegin(1473174000000)
->withEnd(1473177600000)
->withLongTerm(false)
->withPageToken(null)
->withLimit(null)
->withTimeOffsetToken(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
$totalCount = $result->getTotalCount();
$scanSize = $result->getScanSize();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.CountExecuteStampSheetLogRequest;
import io.gs2.log.result.CountExecuteStampSheetLogResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
CountExecuteStampSheetLogResult result = client.countExecuteStampSheetLog(
new CountExecuteStampSheetLogRequest()
.withNamespaceName("namespace-0001")
.withService("inventory")
.withMethod("acquireItemSetByUserId")
.withUserId("user-0001")
.withAction(null)
.withBegin(1473174000000L)
.withEnd(1473177600000L)
.withLongTerm(false)
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(null)
);
List<ExecuteStampSheetLogCount> items = result.getItems();
String nextPageToken = result.getNextPageToken();
long totalCount = result.getTotalCount();
long scanSize = result.getScanSize();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.CountExecuteStampSheetLogResult> asyncResult = null;
yield return client.CountExecuteStampSheetLog(
new Gs2.Gs2Log.Request.CountExecuteStampSheetLogRequest()
.WithNamespaceName("namespace-0001")
.WithService("inventory")
.WithMethod("acquireItemSetByUserId")
.WithUserId("user-0001")
.WithAction(null)
.WithBegin(1473174000000L)
.WithEnd(1473177600000L)
.WithLongTerm(false)
.WithPageToken(null)
.WithLimit(null)
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
var totalCount = result.TotalCount;
var scanSize = result.ScanSize;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.countExecuteStampSheetLog(
new Gs2Log.CountExecuteStampSheetLogRequest()
.withNamespaceName("namespace-0001")
.withService("inventory")
.withMethod("acquireItemSetByUserId")
.withUserId("user-0001")
.withAction(null)
.withBegin(1473174000000)
.withEnd(1473177600000)
.withLongTerm(false)
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
const totalCount = result.getTotalCount();
const scanSize = result.getScanSize();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.count_execute_stamp_sheet_log(
log.CountExecuteStampSheetLogRequest()
.with_namespace_name('namespace-0001')
.with_service('inventory')
.with_method('acquireItemSetByUserId')
.with_user_id('user-0001')
.with_action(None)
.with_begin(1473174000000)
.with_end(1473177600000)
.with_long_term(False)
.with_page_token(None)
.with_limit(None)
.with_time_offset_token(None)
)
items = result.items
next_page_token = result.next_page_token
total_count = result.total_count
scan_size = result.scan_size
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.count_execute_stamp_sheet_log({
namespaceName="namespace-0001",
service="inventory",
method="acquireItemSetByUserId",
userId="user-0001",
action=nil,
begin=1473174000000,
end=1473177600000,
longTerm=false,
pageToken=nil,
limit=nil,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
totalCount = result.totalCount;
scanSize = result.scanSize;client = gs2('log')
api_result_handler = client.count_execute_stamp_sheet_log_async({
namespaceName="namespace-0001",
service="inventory",
method="acquireItemSetByUserId",
userId="user-0001",
action=nil,
begin=1473174000000,
end=1473177600000,
longTerm=false,
pageToken=nil,
limit=nil,
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
totalCount = result.totalCount;
scanSize = result.scanSize;queryExecuteStampTaskLog
소비 액션 실행 로그 목록 조회
지정된 시간 범위 내의 소비 액션 실행 로그를 쿼리합니다.
서비스, 메서드, 사용자 ID, 액션 타입으로 필터링할 수 있습니다. 응답에는 총 건수와 스캔 크기가 포함됩니다. 7일을 초과하는 검색에는 longTerm 플래그를 활성화해야 합니다.
상세
Request
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128자 | 네임스페이스 이름 네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. | ||
| service | string | ~ 1024자 | 마이크로서비스 종류 소비 액션을 실행한 GS2 마이크로서비스의 이름입니다(예: inventory, money). | |||
| method | string | ~ 1024자 | 마이크로서비스의 메서드 소비 액션을 실행하기 위해 마이크로서비스에서 호출된 구체적인 메서드입니다. | |||
| userId | string | ~ 128자 | 사용자ID | |||
| action | string | ~ 1024자 | 소비 액션 실행된 소비 액션의 종류입니다(예: Gs2Inventory:ConsumeItemSetByUserId, Gs2Money:WithdrawByUserId). | |||
| begin | long | 현재 시각으로부터 1시간 전의 절대 시각 | 검색 범위 시작 일시 | |||
| end | long | 현재 시각 | 검색 범위 종료 일시 | |||
| longTerm | bool | false | 7일보다 긴 기간의 로그를 검색 대상으로 할지 여부 | |||
| pageToken | string | ~ 1024자 | 데이터 취득을 시작할 위치를 지정하는 토큰 | |||
| limit | int | 30 | 1 ~ 100 | 취득할 데이터 건수 | ||
| timeOffsetToken | string | ~ 1024자 | 타임 오프셋 토큰 |
Result
| 타입 | 설명 | |
|---|---|---|
| items | List<ExecuteStampTaskLog> | 소비 액션 실행 로그 목록 |
| nextPageToken | string | 목록의 나머지를 취득하기 위한 페이지 토큰 |
| totalCount | long | 쿼리 결과의 총 건수 |
| scanSize | long | 검색 시 스캔한 총 용량(bytes) |
구현 예제
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/log"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := log.Gs2LogRestClient{
Session: &session,
}
result, err := client.QueryExecuteStampTaskLog(
&log.QueryExecuteStampTaskLogRequest {
NamespaceName: pointy.String("namespace-0001"),
Service: pointy.String("inventory"),
Method: pointy.String("consumeItemSetByUserId"),
UserId: pointy.String("user-0001"),
Action: nil,
Begin: pointy.Int64(1473174000000),
End: pointy.Int64(1473177600000),
LongTerm: pointy.Bool(false),
PageToken: nil,
Limit: nil,
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
totalCount := result.TotalCount
scanSize := result.ScanSizeuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\QueryExecuteStampTaskLogRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->queryExecuteStampTaskLog(
(new QueryExecuteStampTaskLogRequest())
->withNamespaceName("namespace-0001")
->withService("inventory")
->withMethod("consumeItemSetByUserId")
->withUserId("user-0001")
->withAction(null)
->withBegin(1473174000000)
->withEnd(1473177600000)
->withLongTerm(false)
->withPageToken(null)
->withLimit(null)
->withTimeOffsetToken(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
$totalCount = $result->getTotalCount();
$scanSize = $result->getScanSize();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.QueryExecuteStampTaskLogRequest;
import io.gs2.log.result.QueryExecuteStampTaskLogResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
QueryExecuteStampTaskLogResult result = client.queryExecuteStampTaskLog(
new QueryExecuteStampTaskLogRequest()
.withNamespaceName("namespace-0001")
.withService("inventory")
.withMethod("consumeItemSetByUserId")
.withUserId("user-0001")
.withAction(null)
.withBegin(1473174000000L)
.withEnd(1473177600000L)
.withLongTerm(false)
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(null)
);
List<ExecuteStampTaskLog> items = result.getItems();
String nextPageToken = result.getNextPageToken();
long totalCount = result.getTotalCount();
long scanSize = result.getScanSize();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.QueryExecuteStampTaskLogResult> asyncResult = null;
yield return client.QueryExecuteStampTaskLog(
new Gs2.Gs2Log.Request.QueryExecuteStampTaskLogRequest()
.WithNamespaceName("namespace-0001")
.WithService("inventory")
.WithMethod("consumeItemSetByUserId")
.WithUserId("user-0001")
.WithAction(null)
.WithBegin(1473174000000L)
.WithEnd(1473177600000L)
.WithLongTerm(false)
.WithPageToken(null)
.WithLimit(null)
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
var totalCount = result.TotalCount;
var scanSize = result.ScanSize;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.queryExecuteStampTaskLog(
new Gs2Log.QueryExecuteStampTaskLogRequest()
.withNamespaceName("namespace-0001")
.withService("inventory")
.withMethod("consumeItemSetByUserId")
.withUserId("user-0001")
.withAction(null)
.withBegin(1473174000000)
.withEnd(1473177600000)
.withLongTerm(false)
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
const totalCount = result.getTotalCount();
const scanSize = result.getScanSize();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.query_execute_stamp_task_log(
log.QueryExecuteStampTaskLogRequest()
.with_namespace_name('namespace-0001')
.with_service('inventory')
.with_method('consumeItemSetByUserId')
.with_user_id('user-0001')
.with_action(None)
.with_begin(1473174000000)
.with_end(1473177600000)
.with_long_term(False)
.with_page_token(None)
.with_limit(None)
.with_time_offset_token(None)
)
items = result.items
next_page_token = result.next_page_token
total_count = result.total_count
scan_size = result.scan_size
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.query_execute_stamp_task_log({
namespaceName="namespace-0001",
service="inventory",
method="consumeItemSetByUserId",
userId="user-0001",
action=nil,
begin=1473174000000,
end=1473177600000,
longTerm=false,
pageToken=nil,
limit=nil,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
totalCount = result.totalCount;
scanSize = result.scanSize;client = gs2('log')
api_result_handler = client.query_execute_stamp_task_log_async({
namespaceName="namespace-0001",
service="inventory",
method="consumeItemSetByUserId",
userId="user-0001",
action=nil,
begin=1473174000000,
end=1473177600000,
longTerm=false,
pageToken=nil,
limit=nil,
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
totalCount = result.totalCount;
scanSize = result.scanSize;countExecuteStampTaskLog
소비 액션 실행 로그의 집계 결과 조회
지정된 시간 범위 내의 소비 액션 실행 로그 건수를 집계합니다. 서비스, 메서드, 사용자 ID, 액션 타입으로 분류할 수 있습니다.
각 분류 플래그에 따라 해당 차원으로 그룹화할지 여부가 제어됩니다.
상세
Request
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128자 | 네임스페이스 이름 네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. | ||
| service | bool | false | 마이크로서비스 종류로 분류할지 여부 | |||
| method | bool | false | 마이크로서비스 메서드로 분류할지 여부 | |||
| userId | bool | false | 사용자 ID로 분류할지 여부 | |||
| action | bool | false | 획득 액션으로 분류할지 여부 | |||
| begin | long | 현재 시각으로부터 1시간 전의 절대 시각 | 검색 범위 시작 일시 | |||
| end | long | 현재 시각 | 검색 범위 종료 일시 | |||
| longTerm | bool | false | 7일보다 긴 기간의 로그를 검색 대상으로 할지 여부 | |||
| pageToken | string | ~ 1024자 | 데이터 취득을 시작할 위치를 지정하는 토큰 | |||
| limit | int | 30 | 1 ~ 1000 | 취득할 데이터 건수 | ||
| timeOffsetToken | string | ~ 1024자 | 타임 오프셋 토큰 |
Result
| 타입 | 설명 | |
|---|---|---|
| items | List<ExecuteStampTaskLogCount> | 소비 액션 실행 로그 집계 목록 |
| nextPageToken | string | 목록의 나머지를 취득하기 위한 페이지 토큰 |
| totalCount | long | 쿼리 결과의 총 건수 |
| scanSize | long | 검색 시 스캔한 총 용량(bytes) |
구현 예제
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/log"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := log.Gs2LogRestClient{
Session: &session,
}
result, err := client.CountExecuteStampTaskLog(
&log.CountExecuteStampTaskLogRequest {
NamespaceName: pointy.String("namespace-0001"),
Service: pointy.String("inventory"),
Method: pointy.String("consumeItemSetByUserId"),
UserId: pointy.String("user-0001"),
Action: nil,
Begin: pointy.Int64(1473174000000),
End: pointy.Int64(1473177600000),
LongTerm: pointy.Bool(false),
PageToken: nil,
Limit: nil,
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
totalCount := result.TotalCount
scanSize := result.ScanSizeuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\CountExecuteStampTaskLogRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->countExecuteStampTaskLog(
(new CountExecuteStampTaskLogRequest())
->withNamespaceName("namespace-0001")
->withService("inventory")
->withMethod("consumeItemSetByUserId")
->withUserId("user-0001")
->withAction(null)
->withBegin(1473174000000)
->withEnd(1473177600000)
->withLongTerm(false)
->withPageToken(null)
->withLimit(null)
->withTimeOffsetToken(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
$totalCount = $result->getTotalCount();
$scanSize = $result->getScanSize();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.CountExecuteStampTaskLogRequest;
import io.gs2.log.result.CountExecuteStampTaskLogResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
CountExecuteStampTaskLogResult result = client.countExecuteStampTaskLog(
new CountExecuteStampTaskLogRequest()
.withNamespaceName("namespace-0001")
.withService("inventory")
.withMethod("consumeItemSetByUserId")
.withUserId("user-0001")
.withAction(null)
.withBegin(1473174000000L)
.withEnd(1473177600000L)
.withLongTerm(false)
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(null)
);
List<ExecuteStampTaskLogCount> items = result.getItems();
String nextPageToken = result.getNextPageToken();
long totalCount = result.getTotalCount();
long scanSize = result.getScanSize();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.CountExecuteStampTaskLogResult> asyncResult = null;
yield return client.CountExecuteStampTaskLog(
new Gs2.Gs2Log.Request.CountExecuteStampTaskLogRequest()
.WithNamespaceName("namespace-0001")
.WithService("inventory")
.WithMethod("consumeItemSetByUserId")
.WithUserId("user-0001")
.WithAction(null)
.WithBegin(1473174000000L)
.WithEnd(1473177600000L)
.WithLongTerm(false)
.WithPageToken(null)
.WithLimit(null)
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
var totalCount = result.TotalCount;
var scanSize = result.ScanSize;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.countExecuteStampTaskLog(
new Gs2Log.CountExecuteStampTaskLogRequest()
.withNamespaceName("namespace-0001")
.withService("inventory")
.withMethod("consumeItemSetByUserId")
.withUserId("user-0001")
.withAction(null)
.withBegin(1473174000000)
.withEnd(1473177600000)
.withLongTerm(false)
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
const totalCount = result.getTotalCount();
const scanSize = result.getScanSize();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.count_execute_stamp_task_log(
log.CountExecuteStampTaskLogRequest()
.with_namespace_name('namespace-0001')
.with_service('inventory')
.with_method('consumeItemSetByUserId')
.with_user_id('user-0001')
.with_action(None)
.with_begin(1473174000000)
.with_end(1473177600000)
.with_long_term(False)
.with_page_token(None)
.with_limit(None)
.with_time_offset_token(None)
)
items = result.items
next_page_token = result.next_page_token
total_count = result.total_count
scan_size = result.scan_size
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.count_execute_stamp_task_log({
namespaceName="namespace-0001",
service="inventory",
method="consumeItemSetByUserId",
userId="user-0001",
action=nil,
begin=1473174000000,
end=1473177600000,
longTerm=false,
pageToken=nil,
limit=nil,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
totalCount = result.totalCount;
scanSize = result.scanSize;client = gs2('log')
api_result_handler = client.count_execute_stamp_task_log_async({
namespaceName="namespace-0001",
service="inventory",
method="consumeItemSetByUserId",
userId="user-0001",
action=nil,
begin=1473174000000,
end=1473177600000,
longTerm=false,
pageToken=nil,
limit=nil,
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
totalCount = result.totalCount;
scanSize = result.scanSize;queryInGameLog
게임 내 로그 목록 조회
지정된 시간 범위 내의 커스텀 게임 내 로그를 쿼리합니다. 사용자 ID와 태그로 필터링할 수 있습니다.
게임 내 로그는 개발자가 정의한 로그 엔트리로, 임의의 페이로드 데이터와 분류용 태그를 포함할 수 있습니다. 7일을 초과하는 검색에는 longTerm 플래그를 활성화해야 합니다.
상세
Request
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128자 | 네임스페이스 이름 네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. | ||
| userId | string | ~ 128자 | 사용자ID | |||
| tags | List<InGameLogTag> | [] | 0 ~ 20 items | 태그 필터링과 분류를 위해 로그 엔트리에 부여된 키-값 쌍입니다. 태그를 통해 인게임 로그의 효율적인 검색과 집계가 가능합니다(예: 이벤트 타입, 스테이지 ID, 아이템 카테고리). | ||
| begin | long | 현재 시각으로부터 1시간 전의 절대 시각 | 검색 범위 시작 일시 | |||
| end | long | 현재 시각으로부터 1시간 후의 절대 시각 | 검색 범위 종료 일시 | |||
| longTerm | bool | false | 7일보다 긴 기간의 로그를 검색 대상으로 할지 여부 | |||
| pageToken | string | ~ 1024자 | 데이터 취득을 시작할 위치를 지정하는 토큰 | |||
| limit | int | 30 | 1 ~ 100 | 취득할 데이터 건수 | ||
| timeOffsetToken | string | ~ 1024자 | 타임 오프셋 토큰 |
Result
| 타입 | 설명 | |
|---|---|---|
| items | List<InGameLog> | 게임 내 로그 목록 |
| nextPageToken | string | 목록의 나머지를 취득하기 위한 페이지 토큰 |
| totalCount | long | 쿼리 결과의 총 건수 |
| scanSize | long | 검색 시 스캔한 총 용량(bytes) |
구현 예제
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/log"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := log.Gs2LogRestClient{
Session: &session,
}
result, err := client.QueryInGameLog(
&log.QueryInGameLogRequest {
NamespaceName: pointy.String("namespace-0001"),
UserId: pointy.String("user-0001"),
Tags: []log.InGameLogTag{
log.InGameLogTag{
Key: pointy.String("tag1"),
Value: pointy.String("value1"),
},
log.InGameLogTag{
Key: pointy.String("tag2"),
Value: pointy.String("value2"),
},
},
Begin: pointy.Int64(1473174000000),
End: pointy.Int64(1473177600000),
LongTerm: pointy.Bool(false),
PageToken: nil,
Limit: nil,
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
totalCount := result.TotalCount
scanSize := result.ScanSizeuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\QueryInGameLogRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->queryInGameLog(
(new QueryInGameLogRequest())
->withNamespaceName("namespace-0001")
->withUserId("user-0001")
->withTags([
(new InGameLogTag())
->withKey("tag1")
->withValue("value1"),
(new InGameLogTag())
->withKey("tag2")
->withValue("value2"),
])
->withBegin(1473174000000)
->withEnd(1473177600000)
->withLongTerm(false)
->withPageToken(null)
->withLimit(null)
->withTimeOffsetToken(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
$totalCount = $result->getTotalCount();
$scanSize = $result->getScanSize();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.QueryInGameLogRequest;
import io.gs2.log.result.QueryInGameLogResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
QueryInGameLogResult result = client.queryInGameLog(
new QueryInGameLogRequest()
.withNamespaceName("namespace-0001")
.withUserId("user-0001")
.withTags(Arrays.asList(
new InGameLogTag()
.withKey("tag1")
.withValue("value1"),
new InGameLogTag()
.withKey("tag2")
.withValue("value2")
))
.withBegin(1473174000000L)
.withEnd(1473177600000L)
.withLongTerm(false)
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(null)
);
List<InGameLog> items = result.getItems();
String nextPageToken = result.getNextPageToken();
long totalCount = result.getTotalCount();
long scanSize = result.getScanSize();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.QueryInGameLogResult> asyncResult = null;
yield return client.QueryInGameLog(
new Gs2.Gs2Log.Request.QueryInGameLogRequest()
.WithNamespaceName("namespace-0001")
.WithUserId("user-0001")
.WithTags(new Gs2.Gs2Log.Model.InGameLogTag[] {
new Gs2.Gs2Log.Model.InGameLogTag()
.WithKey("tag1")
.WithValue("value1"),
new Gs2.Gs2Log.Model.InGameLogTag()
.WithKey("tag2")
.WithValue("value2"),
})
.WithBegin(1473174000000L)
.WithEnd(1473177600000L)
.WithLongTerm(false)
.WithPageToken(null)
.WithLimit(null)
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
var totalCount = result.TotalCount;
var scanSize = result.ScanSize;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.queryInGameLog(
new Gs2Log.QueryInGameLogRequest()
.withNamespaceName("namespace-0001")
.withUserId("user-0001")
.withTags([
new Gs2Log.model.InGameLogTag()
.withKey("tag1")
.withValue("value1"),
new Gs2Log.model.InGameLogTag()
.withKey("tag2")
.withValue("value2"),
])
.withBegin(1473174000000)
.withEnd(1473177600000)
.withLongTerm(false)
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
const totalCount = result.getTotalCount();
const scanSize = result.getScanSize();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.query_in_game_log(
log.QueryInGameLogRequest()
.with_namespace_name('namespace-0001')
.with_user_id('user-0001')
.with_tags([
log.InGameLogTag()
.with_key('tag1')
.with_value('value1'),
log.InGameLogTag()
.with_key('tag2')
.with_value('value2'),
])
.with_begin(1473174000000)
.with_end(1473177600000)
.with_long_term(False)
.with_page_token(None)
.with_limit(None)
.with_time_offset_token(None)
)
items = result.items
next_page_token = result.next_page_token
total_count = result.total_count
scan_size = result.scan_size
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.query_in_game_log({
namespaceName="namespace-0001",
userId="user-0001",
tags={
{
key="tag1",
value="value1",
},
{
key="tag2",
value="value2",
}
},
begin=1473174000000,
end=1473177600000,
longTerm=false,
pageToken=nil,
limit=nil,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
totalCount = result.totalCount;
scanSize = result.scanSize;client = gs2('log')
api_result_handler = client.query_in_game_log_async({
namespaceName="namespace-0001",
userId="user-0001",
tags={
{
key="tag1",
value="value1",
},
{
key="tag2",
value="value2",
}
},
begin=1473174000000,
end=1473177600000,
longTerm=false,
pageToken=nil,
limit=nil,
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
totalCount = result.totalCount;
scanSize = result.scanSize;sendInGameLog
게임 내 로그 전송
지정된 태그와 페이로드를 포함한 커스텀 게임 내 로그 엔트리를 요청한 사용자로서 전송합니다.
태그는 로그 쿼리 시 분류와 필터링에 사용됩니다. 페이로드에는 개발자가 정의한 임의의 데이터를 포함할 수 있습니다.
상세
Request
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128자 | 네임스페이스 이름 네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. | ||
| accessToken | string | ~ 128자 | 액세스 토큰 | |||
| tags | List<InGameLogTag> | [] | 0 ~ 20 items | 태그 필터링과 분류를 위해 로그 엔트리에 부여된 키-값 쌍입니다. 태그를 통해 인게임 로그의 효율적인 검색과 집계가 가능합니다(예: 이벤트 타입, 스테이지 ID, 아이템 카테고리). | ||
| payload | string | ✓ | ~ 10485760자 | 페이로드 JSON 형식의 커스텀 로그 데이터입니다. 플레이어의 행동, 게임 상태, 비즈니스 메트릭 등 게임 고유의 임의의 정보를 포함할 수 있습니다. 최대 10MB까지 가능합니다. |
Result
| 타입 | 설명 | |
|---|---|---|
| item | InGameLog | 게임 내 로그 |
구현 예제
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/log"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := log.Gs2LogRestClient{
Session: &session,
}
result, err := client.SendInGameLog(
&log.SendInGameLogRequest {
NamespaceName: pointy.String("namespace-0001"),
AccessToken: pointy.String("accessToken-0001"),
Tags: []log.InGameLogTag{
log.InGameLogTag{
Key: pointy.String("tag1"),
Value: pointy.String("value1"),
},
log.InGameLogTag{
Key: pointy.String("tag2"),
Value: pointy.String("value2"),
},
},
Payload: pointy.String("{\"category\": \"use-item\", \"count\": 1, \"itemId\": \"item-0001\"}"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\SendInGameLogRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->sendInGameLog(
(new SendInGameLogRequest())
->withNamespaceName("namespace-0001")
->withAccessToken("accessToken-0001")
->withTags([
(new InGameLogTag())
->withKey("tag1")
->withValue("value1"),
(new InGameLogTag())
->withKey("tag2")
->withValue("value2"),
])
->withPayload("{\"category\": \"use-item\", \"count\": 1, \"itemId\": \"item-0001\"}")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.SendInGameLogRequest;
import io.gs2.log.result.SendInGameLogResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
SendInGameLogResult result = client.sendInGameLog(
new SendInGameLogRequest()
.withNamespaceName("namespace-0001")
.withAccessToken("accessToken-0001")
.withTags(Arrays.asList(
new InGameLogTag()
.withKey("tag1")
.withValue("value1"),
new InGameLogTag()
.withKey("tag2")
.withValue("value2")
))
.withPayload("{\"category\": \"use-item\", \"count\": 1, \"itemId\": \"item-0001\"}")
);
InGameLog item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.SendInGameLogResult> asyncResult = null;
yield return client.SendInGameLog(
new Gs2.Gs2Log.Request.SendInGameLogRequest()
.WithNamespaceName("namespace-0001")
.WithAccessToken("accessToken-0001")
.WithTags(new Gs2.Gs2Log.Model.InGameLogTag[] {
new Gs2.Gs2Log.Model.InGameLogTag()
.WithKey("tag1")
.WithValue("value1"),
new Gs2.Gs2Log.Model.InGameLogTag()
.WithKey("tag2")
.WithValue("value2"),
})
.WithPayload("{\"category\": \"use-item\", \"count\": 1, \"itemId\": \"item-0001\"}"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.sendInGameLog(
new Gs2Log.SendInGameLogRequest()
.withNamespaceName("namespace-0001")
.withAccessToken("accessToken-0001")
.withTags([
new Gs2Log.model.InGameLogTag()
.withKey("tag1")
.withValue("value1"),
new Gs2Log.model.InGameLogTag()
.withKey("tag2")
.withValue("value2"),
])
.withPayload("{\"category\": \"use-item\", \"count\": 1, \"itemId\": \"item-0001\"}")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.send_in_game_log(
log.SendInGameLogRequest()
.with_namespace_name('namespace-0001')
.with_access_token('accessToken-0001')
.with_tags([
log.InGameLogTag()
.with_key('tag1')
.with_value('value1'),
log.InGameLogTag()
.with_key('tag2')
.with_value('value2'),
])
.with_payload('{"category": "use-item", "count": 1, "itemId": "item-0001"}')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.send_in_game_log({
namespaceName="namespace-0001",
accessToken="accessToken-0001",
tags={
{
key="tag1",
value="value1",
},
{
key="tag2",
value="value2",
}
},
payload="{\"category\": \"use-item\", \"count\": 1, \"itemId\": \"item-0001\"}",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('log')
api_result_handler = client.send_in_game_log_async({
namespaceName="namespace-0001",
accessToken="accessToken-0001",
tags={
{
key="tag1",
value="value1",
},
{
key="tag2",
value="value2",
}
},
payload="{\"category\": \"use-item\", \"count\": 1, \"itemId\": \"item-0001\"}",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;sendInGameLogByUserId
사용자 ID를 지정하여 게임 내 로그 전송
지정된 사용자의 커스텀 게임 내 로그 엔트리를 지정된 태그와 페이로드로 전송합니다.
상세
Request
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128자 | 네임스페이스 이름 네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. | ||
| userId | string | ~ 128자 | 사용자ID | |||
| tags | List<InGameLogTag> | [] | 0 ~ 20 items | 태그 필터링과 분류를 위해 로그 엔트리에 부여된 키-값 쌍입니다. 태그를 통해 인게임 로그의 효율적인 검색과 집계가 가능합니다(예: 이벤트 타입, 스테이지 ID, 아이템 카테고리). | ||
| payload | string | ✓ | ~ 10485760자 | 페이로드 JSON 형식의 커스텀 로그 데이터입니다. 플레이어의 행동, 게임 상태, 비즈니스 메트릭 등 게임 고유의 임의의 정보를 포함할 수 있습니다. 최대 10MB까지 가능합니다. | ||
| timeOffsetToken | string | ~ 1024자 | 타임 오프셋 토큰 |
Result
| 타입 | 설명 | |
|---|---|---|
| item | InGameLog | 게임 내 로그 |
구현 예제
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/log"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := log.Gs2LogRestClient{
Session: &session,
}
result, err := client.SendInGameLogByUserId(
&log.SendInGameLogByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
UserId: pointy.String("user-0001"),
Tags: []log.InGameLogTag{
log.InGameLogTag{
Key: pointy.String("tag1"),
Value: pointy.String("value1"),
},
log.InGameLogTag{
Key: pointy.String("tag2"),
Value: pointy.String("value2"),
},
},
Payload: pointy.String("{\"category\": \"use-item\", \"count\": 1, \"itemId\": \"item-0001\"}"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\SendInGameLogByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->sendInGameLogByUserId(
(new SendInGameLogByUserIdRequest())
->withNamespaceName("namespace-0001")
->withUserId("user-0001")
->withTags([
(new InGameLogTag())
->withKey("tag1")
->withValue("value1"),
(new InGameLogTag())
->withKey("tag2")
->withValue("value2"),
])
->withPayload("{\"category\": \"use-item\", \"count\": 1, \"itemId\": \"item-0001\"}")
->withTimeOffsetToken(null)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.SendInGameLogByUserIdRequest;
import io.gs2.log.result.SendInGameLogByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
SendInGameLogByUserIdResult result = client.sendInGameLogByUserId(
new SendInGameLogByUserIdRequest()
.withNamespaceName("namespace-0001")
.withUserId("user-0001")
.withTags(Arrays.asList(
new InGameLogTag()
.withKey("tag1")
.withValue("value1"),
new InGameLogTag()
.withKey("tag2")
.withValue("value2")
))
.withPayload("{\"category\": \"use-item\", \"count\": 1, \"itemId\": \"item-0001\"}")
.withTimeOffsetToken(null)
);
InGameLog item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.SendInGameLogByUserIdResult> asyncResult = null;
yield return client.SendInGameLogByUserId(
new Gs2.Gs2Log.Request.SendInGameLogByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithUserId("user-0001")
.WithTags(new Gs2.Gs2Log.Model.InGameLogTag[] {
new Gs2.Gs2Log.Model.InGameLogTag()
.WithKey("tag1")
.WithValue("value1"),
new Gs2.Gs2Log.Model.InGameLogTag()
.WithKey("tag2")
.WithValue("value2"),
})
.WithPayload("{\"category\": \"use-item\", \"count\": 1, \"itemId\": \"item-0001\"}")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.sendInGameLogByUserId(
new Gs2Log.SendInGameLogByUserIdRequest()
.withNamespaceName("namespace-0001")
.withUserId("user-0001")
.withTags([
new Gs2Log.model.InGameLogTag()
.withKey("tag1")
.withValue("value1"),
new Gs2Log.model.InGameLogTag()
.withKey("tag2")
.withValue("value2"),
])
.withPayload("{\"category\": \"use-item\", \"count\": 1, \"itemId\": \"item-0001\"}")
.withTimeOffsetToken(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.send_in_game_log_by_user_id(
log.SendInGameLogByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_user_id('user-0001')
.with_tags([
log.InGameLogTag()
.with_key('tag1')
.with_value('value1'),
log.InGameLogTag()
.with_key('tag2')
.with_value('value2'),
])
.with_payload('{"category": "use-item", "count": 1, "itemId": "item-0001"}')
.with_time_offset_token(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.send_in_game_log_by_user_id({
namespaceName="namespace-0001",
userId="user-0001",
tags={
{
key="tag1",
value="value1",
},
{
key="tag2",
value="value2",
}
},
payload="{\"category\": \"use-item\", \"count\": 1, \"itemId\": \"item-0001\"}",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('log')
api_result_handler = client.send_in_game_log_by_user_id_async({
namespaceName="namespace-0001",
userId="user-0001",
tags={
{
key="tag1",
value="value1",
},
{
key="tag2",
value="value2",
}
},
payload="{\"category\": \"use-item\", \"count\": 1, \"itemId\": \"item-0001\"}",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;queryAccessLogWithTelemetry
텔레메트리가 포함된 액세스 로그 목록 조회
지정된 시간 범위 내의 텔레메트리 데이터를 포함한 액세스 로그를 쿼리합니다. 사용자 ID로 필터링할 수 있습니다.
텔레메트리 데이터는 각 API 호출에 대한 추가적인 성능 및 진단 정보를 제공합니다. 7일을 초과하는 기간을 검색하는 경우 longTerm 플래그를 활성화해야 합니다.
상세
Request
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128자 | 네임스페이스 이름 네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. | ||
| userId | string | ~ 128자 | 사용자ID | |||
| begin | long | 현재 시각으로부터 1시간 전의 절대 시각 | 검색 범위 시작 일시 | |||
| end | long | 현재 시각 | 검색 범위 종료 일시 | |||
| longTerm | bool | false | 7일보다 긴 기간의 로그를 검색 대상으로 할지 여부 | |||
| pageToken | string | ~ 1024자 | 데이터 취득을 시작할 위치를 지정하는 토큰 | |||
| limit | int | 30 | 1 ~ 1000 | 취득할 데이터 건수 | ||
| timeOffsetToken | string | ~ 1024자 | 타임 오프셋 토큰 |
Result
| 타입 | 설명 | |
|---|---|---|
| items | List<AccessLogWithTelemetry> | 액세스 로그 목록 |
| nextPageToken | string | 목록의 나머지를 취득하기 위한 페이지 토큰 |
| totalCount | long | 쿼리 결과의 총 건수 |
| scanSize | long | 검색 시 스캔한 총 용량(bytes) |
구현 예제
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/log"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := log.Gs2LogRestClient{
Session: &session,
}
result, err := client.QueryAccessLogWithTelemetry(
&log.QueryAccessLogWithTelemetryRequest {
NamespaceName: pointy.String("namespace-0001"),
UserId: pointy.String("user-0001"),
Begin: pointy.Int64(1473174000000),
End: pointy.Int64(1473177600000),
LongTerm: pointy.Bool(false),
PageToken: nil,
Limit: nil,
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
totalCount := result.TotalCount
scanSize := result.ScanSizeuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\QueryAccessLogWithTelemetryRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->queryAccessLogWithTelemetry(
(new QueryAccessLogWithTelemetryRequest())
->withNamespaceName("namespace-0001")
->withUserId("user-0001")
->withBegin(1473174000000)
->withEnd(1473177600000)
->withLongTerm(false)
->withPageToken(null)
->withLimit(null)
->withTimeOffsetToken(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
$totalCount = $result->getTotalCount();
$scanSize = $result->getScanSize();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.QueryAccessLogWithTelemetryRequest;
import io.gs2.log.result.QueryAccessLogWithTelemetryResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
QueryAccessLogWithTelemetryResult result = client.queryAccessLogWithTelemetry(
new QueryAccessLogWithTelemetryRequest()
.withNamespaceName("namespace-0001")
.withUserId("user-0001")
.withBegin(1473174000000L)
.withEnd(1473177600000L)
.withLongTerm(false)
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(null)
);
List<AccessLogWithTelemetry> items = result.getItems();
String nextPageToken = result.getNextPageToken();
long totalCount = result.getTotalCount();
long scanSize = result.getScanSize();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.QueryAccessLogWithTelemetryResult> asyncResult = null;
yield return client.QueryAccessLogWithTelemetry(
new Gs2.Gs2Log.Request.QueryAccessLogWithTelemetryRequest()
.WithNamespaceName("namespace-0001")
.WithUserId("user-0001")
.WithBegin(1473174000000L)
.WithEnd(1473177600000L)
.WithLongTerm(false)
.WithPageToken(null)
.WithLimit(null)
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
var totalCount = result.TotalCount;
var scanSize = result.ScanSize;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.queryAccessLogWithTelemetry(
new Gs2Log.QueryAccessLogWithTelemetryRequest()
.withNamespaceName("namespace-0001")
.withUserId("user-0001")
.withBegin(1473174000000)
.withEnd(1473177600000)
.withLongTerm(false)
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
const totalCount = result.getTotalCount();
const scanSize = result.getScanSize();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.query_access_log_with_telemetry(
log.QueryAccessLogWithTelemetryRequest()
.with_namespace_name('namespace-0001')
.with_user_id('user-0001')
.with_begin(1473174000000)
.with_end(1473177600000)
.with_long_term(False)
.with_page_token(None)
.with_limit(None)
.with_time_offset_token(None)
)
items = result.items
next_page_token = result.next_page_token
total_count = result.total_count
scan_size = result.scan_size
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.query_access_log_with_telemetry({
namespaceName="namespace-0001",
userId="user-0001",
begin=1473174000000,
end=1473177600000,
longTerm=false,
pageToken=nil,
limit=nil,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
totalCount = result.totalCount;
scanSize = result.scanSize;client = gs2('log')
api_result_handler = client.query_access_log_with_telemetry_async({
namespaceName="namespace-0001",
userId="user-0001",
begin=1473174000000,
end=1473177600000,
longTerm=false,
pageToken=nil,
limit=nil,
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
totalCount = result.totalCount;
scanSize = result.scanSize;describeInsights
GS2-Insight 인스턴스 목록 조회
지정된 네임스페이스의 GS2-Insight 인스턴스 페이지네이션 목록을 가져옵니다.
각 Insight는 로그 분석 환경을 나타내며, 시작 후 2시간이 지나면 자동으로 종료됩니다.
상세
Request
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128자 | 네임스페이스 이름 네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. | ||
| pageToken | string | ~ 1024자 | 데이터 취득을 시작할 위치를 지정하는 토큰 | |||
| limit | int | 30 | 1 ~ 1000 | 취득할 데이터 건수 |
Result
| 타입 | 설명 | |
|---|---|---|
| items | List<Insight> | GS2-Insight 목록 |
| nextPageToken | string | 목록의 나머지를 취득하기 위한 페이지 토큰 |
구현 예제
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/log"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := log.Gs2LogRestClient{
Session: &session,
}
result, err := client.DescribeInsights(
&log.DescribeInsightsRequest {
NamespaceName: pointy.String("namespace-0001"),
PageToken: nil,
Limit: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageTokenuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\DescribeInsightsRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->describeInsights(
(new DescribeInsightsRequest())
->withNamespaceName("namespace-0001")
->withPageToken(null)
->withLimit(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.DescribeInsightsRequest;
import io.gs2.log.result.DescribeInsightsResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
DescribeInsightsResult result = client.describeInsights(
new DescribeInsightsRequest()
.withNamespaceName("namespace-0001")
.withPageToken(null)
.withLimit(null)
);
List<Insight> items = result.getItems();
String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.DescribeInsightsResult> asyncResult = null;
yield return client.DescribeInsights(
new Gs2.Gs2Log.Request.DescribeInsightsRequest()
.WithNamespaceName("namespace-0001")
.WithPageToken(null)
.WithLimit(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.describeInsights(
new Gs2Log.DescribeInsightsRequest()
.withNamespaceName("namespace-0001")
.withPageToken(null)
.withLimit(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.describe_insights(
log.DescribeInsightsRequest()
.with_namespace_name('namespace-0001')
.with_page_token(None)
.with_limit(None)
)
items = result.items
next_page_token = result.next_page_token
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.describe_insights({
namespaceName="namespace-0001",
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;client = gs2('log')
api_result_handler = client.describe_insights_async({
namespaceName="namespace-0001",
pageToken=nil,
limit=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;createInsight
GS2-Insight 시작
지정된 네임스페이스에 새로운 GS2-Insight 로그 분석 환경을 시작합니다.
Insight 인스턴스는 시작 후 2시간이 지나면 자동으로 종료됩니다. 네임스페이스당 동시에 활성화할 수 있는 인스턴스는 1개뿐입니다.
상세
Request
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128자 | 네임스페이스 이름 네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. |
Result
| 타입 | 설명 | |
|---|---|---|
| item | Insight | GS2-Insight |
구현 예제
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/log"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := log.Gs2LogRestClient{
Session: &session,
}
result, err := client.CreateInsight(
&log.CreateInsightRequest {
NamespaceName: pointy.String("namespace-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\CreateInsightRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->createInsight(
(new CreateInsightRequest())
->withNamespaceName("namespace-0001")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.CreateInsightRequest;
import io.gs2.log.result.CreateInsightResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
CreateInsightResult result = client.createInsight(
new CreateInsightRequest()
.withNamespaceName("namespace-0001")
);
Insight item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.CreateInsightResult> asyncResult = null;
yield return client.CreateInsight(
new Gs2.Gs2Log.Request.CreateInsightRequest()
.WithNamespaceName("namespace-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.createInsight(
new Gs2Log.CreateInsightRequest()
.withNamespaceName("namespace-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.create_insight(
log.CreateInsightRequest()
.with_namespace_name('namespace-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.create_insight({
namespaceName="namespace-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('log')
api_result_handler = client.create_insight_async({
namespaceName="namespace-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;getInsight
GS2-Insight 조회
지정된 GS2-Insight 인스턴스의 현재 상태와 시작 시각을 포함한 정보를 가져옵니다.
상세
Request
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128자 | 네임스페이스 이름 네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. | ||
| insightName | string | ✓ | UUID | ~ 36자 | 이름 |
Result
| 타입 | 설명 | |
|---|---|---|
| item | Insight | GS2-Insight |
구현 예제
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/log"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := log.Gs2LogRestClient{
Session: &session,
}
result, err := client.GetInsight(
&log.GetInsightRequest {
NamespaceName: pointy.String("namespace-0001"),
InsightName: pointy.String("insight1-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\GetInsightRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->getInsight(
(new GetInsightRequest())
->withNamespaceName("namespace-0001")
->withInsightName("insight1-0001")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.GetInsightRequest;
import io.gs2.log.result.GetInsightResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
GetInsightResult result = client.getInsight(
new GetInsightRequest()
.withNamespaceName("namespace-0001")
.withInsightName("insight1-0001")
);
Insight item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.GetInsightResult> asyncResult = null;
yield return client.GetInsight(
new Gs2.Gs2Log.Request.GetInsightRequest()
.WithNamespaceName("namespace-0001")
.WithInsightName("insight1-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.getInsight(
new Gs2Log.GetInsightRequest()
.withNamespaceName("namespace-0001")
.withInsightName("insight1-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.get_insight(
log.GetInsightRequest()
.with_namespace_name('namespace-0001')
.with_insight_name('insight1-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.get_insight({
namespaceName="namespace-0001",
insightName="insight1-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('log')
api_result_handler = client.get_insight_async({
namespaceName="namespace-0001",
insightName="insight1-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;deleteInsight
GS2-Insight 삭제
지정된 GS2-Insight 인스턴스를 삭제하고 로그 분석 환경을 즉시 종료합니다.
상세
Request
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128자 | 네임스페이스 이름 네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. | ||
| insightName | string | ✓ | UUID | ~ 36자 | 이름 |
Result
| 타입 | 설명 | |
|---|---|---|
| item | Insight | GS2-Insight |
구현 예제
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/log"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := log.Gs2LogRestClient{
Session: &session,
}
result, err := client.DeleteInsight(
&log.DeleteInsightRequest {
NamespaceName: pointy.String("namespace-0001"),
InsightName: pointy.String("insight1-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\DeleteInsightRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->deleteInsight(
(new DeleteInsightRequest())
->withNamespaceName("namespace-0001")
->withInsightName("insight1-0001")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.DeleteInsightRequest;
import io.gs2.log.result.DeleteInsightResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
DeleteInsightResult result = client.deleteInsight(
new DeleteInsightRequest()
.withNamespaceName("namespace-0001")
.withInsightName("insight1-0001")
);
Insight item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.DeleteInsightResult> asyncResult = null;
yield return client.DeleteInsight(
new Gs2.Gs2Log.Request.DeleteInsightRequest()
.WithNamespaceName("namespace-0001")
.WithInsightName("insight1-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.deleteInsight(
new Gs2Log.DeleteInsightRequest()
.withNamespaceName("namespace-0001")
.withInsightName("insight1-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.delete_insight(
log.DeleteInsightRequest()
.with_namespace_name('namespace-0001')
.with_insight_name('insight1-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.delete_insight({
namespaceName="namespace-0001",
insightName="insight1-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('log')
api_result_handler = client.delete_insight_async({
namespaceName="namespace-0001",
insightName="insight1-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;describeDashboards
대시보드 목록 조회
지정된 네임스페이스의 대시보드 페이지네이션 목록을 가져옵니다.
대시보드는 로그 데이터와 메트릭을 시각화하는 커스터마이즈 가능한 뷰를 제공합니다. 이름 접두사로 필터링할 수 있습니다.
상세
Request
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128자 | 네임스페이스 이름 네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. | ||
| namePrefix | string | ~ 64자 | 대시보드 이름 필터 접두사 | |||
| pageToken | string | ~ 1024자 | 데이터 취득을 시작할 위치를 지정하는 토큰 | |||
| limit | int | 30 | 1 ~ 1000 | 취득할 데이터 건수 |
Result
| 타입 | 설명 | |
|---|---|---|
| items | List<Dashboard> | 대시보드 목록 |
| nextPageToken | string | 목록의 나머지를 취득하기 위한 페이지 토큰 |
구현 예제
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/log"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := log.Gs2LogRestClient{
Session: &session,
}
result, err := client.DescribeDashboards(
&log.DescribeDashboardsRequest {
NamespaceName: pointy.String("namespace-0001"),
NamePrefix: nil,
PageToken: nil,
Limit: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageTokenuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\DescribeDashboardsRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->describeDashboards(
(new DescribeDashboardsRequest())
->withNamespaceName("namespace-0001")
->withNamePrefix(null)
->withPageToken(null)
->withLimit(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.DescribeDashboardsRequest;
import io.gs2.log.result.DescribeDashboardsResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
DescribeDashboardsResult result = client.describeDashboards(
new DescribeDashboardsRequest()
.withNamespaceName("namespace-0001")
.withNamePrefix(null)
.withPageToken(null)
.withLimit(null)
);
List<Dashboard> items = result.getItems();
String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.DescribeDashboardsResult> asyncResult = null;
yield return client.DescribeDashboards(
new Gs2.Gs2Log.Request.DescribeDashboardsRequest()
.WithNamespaceName("namespace-0001")
.WithNamePrefix(null)
.WithPageToken(null)
.WithLimit(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.describeDashboards(
new Gs2Log.DescribeDashboardsRequest()
.withNamespaceName("namespace-0001")
.withNamePrefix(null)
.withPageToken(null)
.withLimit(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.describe_dashboards(
log.DescribeDashboardsRequest()
.with_namespace_name('namespace-0001')
.with_name_prefix(None)
.with_page_token(None)
.with_limit(None)
)
items = result.items
next_page_token = result.next_page_token
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.describe_dashboards({
namespaceName="namespace-0001",
namePrefix=nil,
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;client = gs2('log')
api_result_handler = client.describe_dashboards_async({
namespaceName="namespace-0001",
namePrefix=nil,
pageToken=nil,
limit=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;createDashboard
대시보드 신규 생성
지정된 표시 이름과 설명으로 새 대시보드를 생성합니다.
대시보드의 페이로드(레이아웃 및 위젯 설정)는 이후 업데이트를 통해 설정할 수 있습니다.
상세
Request
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128자 | 네임스페이스 이름 네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. | ||
| displayName | string | ✓ | ~ 256자 | 표시용 이름 이 대시보드의 사람이 읽기 쉬운 이름으로, 대시보드 목록과 헤더에 표시됩니다. | ||
| description | string | ~ 1024자 | 설명문 |
Result
| 타입 | 설명 | |
|---|---|---|
| item | Dashboard | 생성한 대시보드 |
구현 예제
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/log"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := log.Gs2LogRestClient{
Session: &session,
}
result, err := client.CreateDashboard(
&log.CreateDashboardRequest {
NamespaceName: pointy.String("namespace-0001"),
DisplayName: pointy.String("Sample Dashboard 0001"),
Description: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\CreateDashboardRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->createDashboard(
(new CreateDashboardRequest())
->withNamespaceName("namespace-0001")
->withDisplayName("Sample Dashboard 0001")
->withDescription(null)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.CreateDashboardRequest;
import io.gs2.log.result.CreateDashboardResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
CreateDashboardResult result = client.createDashboard(
new CreateDashboardRequest()
.withNamespaceName("namespace-0001")
.withDisplayName("Sample Dashboard 0001")
.withDescription(null)
);
Dashboard item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.CreateDashboardResult> asyncResult = null;
yield return client.CreateDashboard(
new Gs2.Gs2Log.Request.CreateDashboardRequest()
.WithNamespaceName("namespace-0001")
.WithDisplayName("Sample Dashboard 0001")
.WithDescription(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.createDashboard(
new Gs2Log.CreateDashboardRequest()
.withNamespaceName("namespace-0001")
.withDisplayName("Sample Dashboard 0001")
.withDescription(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.create_dashboard(
log.CreateDashboardRequest()
.with_namespace_name('namespace-0001')
.with_display_name('Sample Dashboard 0001')
.with_description(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.create_dashboard({
namespaceName="namespace-0001",
displayName="Sample Dashboard 0001",
description=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('log')
api_result_handler = client.create_dashboard_async({
namespaceName="namespace-0001",
displayName="Sample Dashboard 0001",
description=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;getDashboard
대시보드 조회
지정된 대시보드의 표시 이름, 설명, 페이로드 설정을 포함한 정보를 가져옵니다.
상세
Request
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128자 | 네임스페이스 이름 네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. | ||
| dashboardName | string | ✓ | UUID | ~ 36자 | 대시보드 이름 |
Result
| 타입 | 설명 | |
|---|---|---|
| item | Dashboard | 대시보드 |
구현 예제
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/log"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := log.Gs2LogRestClient{
Session: &session,
}
result, err := client.GetDashboard(
&log.GetDashboardRequest {
NamespaceName: pointy.String("namespace-0001"),
DashboardName: pointy.String("dashboard-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\GetDashboardRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->getDashboard(
(new GetDashboardRequest())
->withNamespaceName("namespace-0001")
->withDashboardName("dashboard-0001")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.GetDashboardRequest;
import io.gs2.log.result.GetDashboardResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
GetDashboardResult result = client.getDashboard(
new GetDashboardRequest()
.withNamespaceName("namespace-0001")
.withDashboardName("dashboard-0001")
);
Dashboard item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.GetDashboardResult> asyncResult = null;
yield return client.GetDashboard(
new Gs2.Gs2Log.Request.GetDashboardRequest()
.WithNamespaceName("namespace-0001")
.WithDashboardName("dashboard-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.getDashboard(
new Gs2Log.GetDashboardRequest()
.withNamespaceName("namespace-0001")
.withDashboardName("dashboard-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.get_dashboard(
log.GetDashboardRequest()
.with_namespace_name('namespace-0001')
.with_dashboard_name('dashboard-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.get_dashboard({
namespaceName="namespace-0001",
dashboardName="dashboard-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('log')
api_result_handler = client.get_dashboard_async({
namespaceName="namespace-0001",
dashboardName="dashboard-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;updateDashboard
대시보드 업데이트
지정된 대시보드의 표시 이름, 설명, 페이로드 설정을 업데이트합니다.
페이로드에는 대시보드의 레이아웃과 위젯 정의가 포함됩니다.
상세
Request
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128자 | 네임스페이스 이름 네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. | ||
| dashboardName | string | ✓ | UUID | ~ 36자 | 대시보드 이름 | |
| displayName | string | ✓ | ~ 256자 | 표시용 이름 이 대시보드의 사람이 읽기 쉬운 이름으로, 대시보드 목록과 헤더에 표시됩니다. | ||
| description | string | ~ 1024자 | 설명문 | |||
| payload | string | ✓ | ~ 1048576자 | 페이로드 위젯 정의, 레이아웃 정보, 쿼리 설정, 시각화 옵션을 포함하는 JSON 형식의 대시보드 설정입니다. |
Result
| 타입 | 설명 | |
|---|---|---|
| item | Dashboard | 업데이트한 대시보드 |
구현 예제
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/log"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := log.Gs2LogRestClient{
Session: &session,
}
result, err := client.UpdateDashboard(
&log.UpdateDashboardRequest {
NamespaceName: pointy.String("namespace-0001"),
DashboardName: pointy.String("dashboard-0001"),
DisplayName: pointy.String("Sample Dashboard 0001"),
Description: nil,
Payload: pointy.String("{\"widgets\": []}"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\UpdateDashboardRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->updateDashboard(
(new UpdateDashboardRequest())
->withNamespaceName("namespace-0001")
->withDashboardName("dashboard-0001")
->withDisplayName("Sample Dashboard 0001")
->withDescription(null)
->withPayload("{\"widgets\": []}")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.UpdateDashboardRequest;
import io.gs2.log.result.UpdateDashboardResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
UpdateDashboardResult result = client.updateDashboard(
new UpdateDashboardRequest()
.withNamespaceName("namespace-0001")
.withDashboardName("dashboard-0001")
.withDisplayName("Sample Dashboard 0001")
.withDescription(null)
.withPayload("{\"widgets\": []}")
);
Dashboard item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.UpdateDashboardResult> asyncResult = null;
yield return client.UpdateDashboard(
new Gs2.Gs2Log.Request.UpdateDashboardRequest()
.WithNamespaceName("namespace-0001")
.WithDashboardName("dashboard-0001")
.WithDisplayName("Sample Dashboard 0001")
.WithDescription(null)
.WithPayload("{\"widgets\": []}"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.updateDashboard(
new Gs2Log.UpdateDashboardRequest()
.withNamespaceName("namespace-0001")
.withDashboardName("dashboard-0001")
.withDisplayName("Sample Dashboard 0001")
.withDescription(null)
.withPayload("{\"widgets\": []}")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.update_dashboard(
log.UpdateDashboardRequest()
.with_namespace_name('namespace-0001')
.with_dashboard_name('dashboard-0001')
.with_display_name('Sample Dashboard 0001')
.with_description(None)
.with_payload('{"widgets": []}')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.update_dashboard({
namespaceName="namespace-0001",
dashboardName="dashboard-0001",
displayName="Sample Dashboard 0001",
description=nil,
payload="{\"widgets\": []}",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('log')
api_result_handler = client.update_dashboard_async({
namespaceName="namespace-0001",
dashboardName="dashboard-0001",
displayName="Sample Dashboard 0001",
description=nil,
payload="{\"widgets\": []}",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;duplicateDashboard
대시보드 복제
지정된 대시보드의 페이로드(레이아웃과 위젯 정의)를 포함한 전체 설정의 사본을 생성합니다.
상세
Request
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128자 | 네임스페이스 이름 네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. | ||
| dashboardName | string | ✓ | UUID | ~ 36자 | 대시보드 이름 |
Result
| 타입 | 설명 | |
|---|---|---|
| item | Dashboard | 생성한 대시보드 |
구현 예제
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/log"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := log.Gs2LogRestClient{
Session: &session,
}
result, err := client.DuplicateDashboard(
&log.DuplicateDashboardRequest {
NamespaceName: pointy.String("namespace-0001"),
DashboardName: pointy.String("dashboard-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\DuplicateDashboardRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->duplicateDashboard(
(new DuplicateDashboardRequest())
->withNamespaceName("namespace-0001")
->withDashboardName("dashboard-0001")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.DuplicateDashboardRequest;
import io.gs2.log.result.DuplicateDashboardResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
DuplicateDashboardResult result = client.duplicateDashboard(
new DuplicateDashboardRequest()
.withNamespaceName("namespace-0001")
.withDashboardName("dashboard-0001")
);
Dashboard item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.DuplicateDashboardResult> asyncResult = null;
yield return client.DuplicateDashboard(
new Gs2.Gs2Log.Request.DuplicateDashboardRequest()
.WithNamespaceName("namespace-0001")
.WithDashboardName("dashboard-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.duplicateDashboard(
new Gs2Log.DuplicateDashboardRequest()
.withNamespaceName("namespace-0001")
.withDashboardName("dashboard-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.duplicate_dashboard(
log.DuplicateDashboardRequest()
.with_namespace_name('namespace-0001')
.with_dashboard_name('dashboard-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.duplicate_dashboard({
namespaceName="namespace-0001",
dashboardName="dashboard-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('log')
api_result_handler = client.duplicate_dashboard_async({
namespaceName="namespace-0001",
dashboardName="dashboard-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;deleteDashboard
대시보드 삭제
지정된 대시보드와 그 전체 설정을 완전히 삭제합니다.
상세
Request
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128자 | 네임스페이스 이름 네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. | ||
| dashboardName | string | ✓ | UUID | ~ 36자 | 대시보드 이름 |
Result
| 타입 | 설명 | |
|---|---|---|
| item | Dashboard | 삭제한 대시보드 |
구현 예제
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/log"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := log.Gs2LogRestClient{
Session: &session,
}
result, err := client.DeleteDashboard(
&log.DeleteDashboardRequest {
NamespaceName: pointy.String("namespace-0001"),
DashboardName: pointy.String("dashboard-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\DeleteDashboardRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->deleteDashboard(
(new DeleteDashboardRequest())
->withNamespaceName("namespace-0001")
->withDashboardName("dashboard-0001")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.DeleteDashboardRequest;
import io.gs2.log.result.DeleteDashboardResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
DeleteDashboardResult result = client.deleteDashboard(
new DeleteDashboardRequest()
.withNamespaceName("namespace-0001")
.withDashboardName("dashboard-0001")
);
Dashboard item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.DeleteDashboardResult> asyncResult = null;
yield return client.DeleteDashboard(
new Gs2.Gs2Log.Request.DeleteDashboardRequest()
.WithNamespaceName("namespace-0001")
.WithDashboardName("dashboard-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.deleteDashboard(
new Gs2Log.DeleteDashboardRequest()
.withNamespaceName("namespace-0001")
.withDashboardName("dashboard-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.delete_dashboard(
log.DeleteDashboardRequest()
.with_namespace_name('namespace-0001')
.with_dashboard_name('dashboard-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.delete_dashboard({
namespaceName="namespace-0001",
dashboardName="dashboard-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('log')
api_result_handler = client.delete_dashboard_async({
namespaceName="namespace-0001",
dashboardName="dashboard-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;describeFacetModels
패싯 모델 목록을 조회
지정된 네임스페이스의 패싯 모델을 페이지네이션 방식으로 조회합니다.
패싯 모델은 로그 쿼리용 커스텀 분류 필드를 정의하며, 필드 이름, 타입(string 또는 measure), 표시 이름, 정렬 순서를 지정합니다.
상세
Request
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128자 | 네임스페이스 이름 네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. | ||
| namePrefix | string | ~ 64자 | 패싯 모델 이름의 필터 접두사 | |||
| pageToken | string | ~ 1024자 | 데이터 취득을 시작할 위치를 지정하는 토큰 | |||
| limit | int | 30 | 1 ~ 1000 | 취득할 데이터 건수 |
Result
| 타입 | 설명 | |
|---|---|---|
| items | List<FacetModel> | 패싯 모델 목록 |
| nextPageToken | string | 목록의 나머지를 취득하기 위한 페이지 토큰 |
구현 예제
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/log"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := log.Gs2LogRestClient{
Session: &session,
}
result, err := client.DescribeFacetModels(
&log.DescribeFacetModelsRequest {
NamespaceName: pointy.String("namespace-0001"),
NamePrefix: nil,
PageToken: nil,
Limit: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageTokenuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\DescribeFacetModelsRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->describeFacetModels(
(new DescribeFacetModelsRequest())
->withNamespaceName("namespace-0001")
->withNamePrefix(null)
->withPageToken(null)
->withLimit(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.DescribeFacetModelsRequest;
import io.gs2.log.result.DescribeFacetModelsResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
DescribeFacetModelsResult result = client.describeFacetModels(
new DescribeFacetModelsRequest()
.withNamespaceName("namespace-0001")
.withNamePrefix(null)
.withPageToken(null)
.withLimit(null)
);
List<FacetModel> items = result.getItems();
String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.DescribeFacetModelsResult> asyncResult = null;
yield return client.DescribeFacetModels(
new Gs2.Gs2Log.Request.DescribeFacetModelsRequest()
.WithNamespaceName("namespace-0001")
.WithNamePrefix(null)
.WithPageToken(null)
.WithLimit(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.describeFacetModels(
new Gs2Log.DescribeFacetModelsRequest()
.withNamespaceName("namespace-0001")
.withNamePrefix(null)
.withPageToken(null)
.withLimit(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.describe_facet_models(
log.DescribeFacetModelsRequest()
.with_namespace_name('namespace-0001')
.with_name_prefix(None)
.with_page_token(None)
.with_limit(None)
)
items = result.items
next_page_token = result.next_page_token
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.describe_facet_models({
namespaceName="namespace-0001",
namePrefix=nil,
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;client = gs2('log')
api_result_handler = client.describe_facet_models_async({
namespaceName="namespace-0001",
namePrefix=nil,
pageToken=nil,
limit=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;createFacetModel
패싯 모델을 신규 작성
지정된 필드 이름, 타입, 표시 이름, 정렬 순서로 새로운 패싯 모델을 작성합니다.
필드 타입은 카테고리 분류용 ‘string’ 또는 로그 쿼리에서의 수치 집계용 ‘measure’를 지정할 수 있습니다.
상세
Request
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128자 | 네임스페이스 이름 네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. | ||||||||||
| field | string | ✓ | ~ 128자 | 패싯 필드 이름 이 패싯이 대상으로 하는 로그 필드의 이름입니다(예: “service”, “method”, “status”). | ||||||||||
| type | 문자열 열거형 enum { “string”, “double”, “measure” } | ✓ | 패싯 데이터 타입 패싯 필드의 데이터 타입입니다. “string"은 값 카운트가 있는 범주형 값에, “double"은 범위 필터링이 있는 숫자 값에, “measure"는 통계 분석이 있는 측정값에 사용됩니다.
| |||||||||||
| displayName | string | ✓ | ~ 128자 | 표시용 이름 이 패싯의 사람이 읽을 수 있는 이름으로, 로그 검색 UI에 표시됩니다. | ||||||||||
| order | int | 0 | 0 ~ 100000 | 표시 순서 UI에서 이 패싯을 표시할 때의 정렬 순서입니다. 값이 작을수록 먼저 표시됩니다. |
Result
| 타입 | 설명 | |
|---|---|---|
| item | FacetModel | 생성한 패싯 모델 |
구현 예제
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/log"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := log.Gs2LogRestClient{
Session: &session,
}
result, err := client.CreateFacetModel(
&log.CreateFacetModelRequest {
NamespaceName: pointy.String("namespace-0001"),
Field: pointy.String("facet-model-0001"),
Type: pointy.String("string"),
DisplayName: pointy.String("Sample Facet Model 0001"),
Order: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\CreateFacetModelRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->createFacetModel(
(new CreateFacetModelRequest())
->withNamespaceName("namespace-0001")
->withField("facet-model-0001")
->withType("string")
->withDisplayName("Sample Facet Model 0001")
->withOrder(null)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.CreateFacetModelRequest;
import io.gs2.log.result.CreateFacetModelResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
CreateFacetModelResult result = client.createFacetModel(
new CreateFacetModelRequest()
.withNamespaceName("namespace-0001")
.withField("facet-model-0001")
.withType("string")
.withDisplayName("Sample Facet Model 0001")
.withOrder(null)
);
FacetModel item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.CreateFacetModelResult> asyncResult = null;
yield return client.CreateFacetModel(
new Gs2.Gs2Log.Request.CreateFacetModelRequest()
.WithNamespaceName("namespace-0001")
.WithField("facet-model-0001")
.WithType("string")
.WithDisplayName("Sample Facet Model 0001")
.WithOrder(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.createFacetModel(
new Gs2Log.CreateFacetModelRequest()
.withNamespaceName("namespace-0001")
.withField("facet-model-0001")
.withType("string")
.withDisplayName("Sample Facet Model 0001")
.withOrder(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.create_facet_model(
log.CreateFacetModelRequest()
.with_namespace_name('namespace-0001')
.with_field('facet-model-0001')
.with_type('string')
.with_display_name('Sample Facet Model 0001')
.with_order(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.create_facet_model({
namespaceName="namespace-0001",
field="facet-model-0001",
type="string",
displayName="Sample Facet Model 0001",
order=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('log')
api_result_handler = client.create_facet_model_async({
namespaceName="namespace-0001",
field="facet-model-0001",
type="string",
displayName="Sample Facet Model 0001",
order=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;getFacetModel
패싯 모델을 조회
지정된 패싯 모델의 필드 이름, 타입, 표시 이름, 정렬 순서를 포함한 정보를 조회합니다.
상세
Request
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128자 | 네임스페이스 이름 네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. | ||
| field | string | ✓ | ~ 128자 | 패싯 필드 이름 이 패싯이 대상으로 하는 로그 필드의 이름입니다(예: “service”, “method”, “status”). |
Result
| 타입 | 설명 | |
|---|---|---|
| item | FacetModel | 패싯 모델 |
구현 예제
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/log"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := log.Gs2LogRestClient{
Session: &session,
}
result, err := client.GetFacetModel(
&log.GetFacetModelRequest {
NamespaceName: pointy.String("namespace-0001"),
Field: pointy.String("facet-model-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\GetFacetModelRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->getFacetModel(
(new GetFacetModelRequest())
->withNamespaceName("namespace-0001")
->withField("facet-model-0001")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.GetFacetModelRequest;
import io.gs2.log.result.GetFacetModelResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
GetFacetModelResult result = client.getFacetModel(
new GetFacetModelRequest()
.withNamespaceName("namespace-0001")
.withField("facet-model-0001")
);
FacetModel item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.GetFacetModelResult> asyncResult = null;
yield return client.GetFacetModel(
new Gs2.Gs2Log.Request.GetFacetModelRequest()
.WithNamespaceName("namespace-0001")
.WithField("facet-model-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.getFacetModel(
new Gs2Log.GetFacetModelRequest()
.withNamespaceName("namespace-0001")
.withField("facet-model-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.get_facet_model(
log.GetFacetModelRequest()
.with_namespace_name('namespace-0001')
.with_field('facet-model-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.get_facet_model({
namespaceName="namespace-0001",
field="facet-model-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('log')
api_result_handler = client.get_facet_model_async({
namespaceName="namespace-0001",
field="facet-model-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;updateFacetModel
패싯 모델 업데이트
지정된 패싯 모델의 타입, 표시 이름, 정렬 순서를 업데이트합니다.
상세
Request
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128자 | 네임스페이스 이름 네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. | ||||||||||
| field | string | ✓ | ~ 128자 | 패싯 필드 이름 이 패싯이 대상으로 하는 로그 필드의 이름입니다(예: “service”, “method”, “status”). | ||||||||||
| type | 문자열 열거형 enum { “string”, “double”, “measure” } | ✓ | 패싯 데이터 타입 패싯 필드의 데이터 타입입니다. “string"은 값 카운트가 있는 범주형 값에, “double"은 범위 필터링이 있는 숫자 값에, “measure"는 통계 분석이 있는 측정값에 사용됩니다.
| |||||||||||
| displayName | string | ✓ | ~ 128자 | 표시용 이름 이 패싯의 사람이 읽을 수 있는 이름으로, 로그 검색 UI에 표시됩니다. | ||||||||||
| order | int | 0 | 0 ~ 100000 | 표시 순서 UI에서 이 패싯을 표시할 때의 정렬 순서입니다. 값이 작을수록 먼저 표시됩니다. |
Result
| 타입 | 설명 | |
|---|---|---|
| item | FacetModel | 업데이트한 패싯 모델 |
구현 예제
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/log"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := log.Gs2LogRestClient{
Session: &session,
}
result, err := client.UpdateFacetModel(
&log.UpdateFacetModelRequest {
NamespaceName: pointy.String("namespace-0001"),
Field: pointy.String("facet-model-0001"),
Type: pointy.String("gs2"),
DisplayName: pointy.String("Sample Facet Model 0001"),
Order: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\UpdateFacetModelRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->updateFacetModel(
(new UpdateFacetModelRequest())
->withNamespaceName("namespace-0001")
->withField("facet-model-0001")
->withType("gs2")
->withDisplayName("Sample Facet Model 0001")
->withOrder(null)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.UpdateFacetModelRequest;
import io.gs2.log.result.UpdateFacetModelResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
UpdateFacetModelResult result = client.updateFacetModel(
new UpdateFacetModelRequest()
.withNamespaceName("namespace-0001")
.withField("facet-model-0001")
.withType("gs2")
.withDisplayName("Sample Facet Model 0001")
.withOrder(null)
);
FacetModel item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.UpdateFacetModelResult> asyncResult = null;
yield return client.UpdateFacetModel(
new Gs2.Gs2Log.Request.UpdateFacetModelRequest()
.WithNamespaceName("namespace-0001")
.WithField("facet-model-0001")
.WithType("gs2")
.WithDisplayName("Sample Facet Model 0001")
.WithOrder(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.updateFacetModel(
new Gs2Log.UpdateFacetModelRequest()
.withNamespaceName("namespace-0001")
.withField("facet-model-0001")
.withType("gs2")
.withDisplayName("Sample Facet Model 0001")
.withOrder(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.update_facet_model(
log.UpdateFacetModelRequest()
.with_namespace_name('namespace-0001')
.with_field('facet-model-0001')
.with_type('gs2')
.with_display_name('Sample Facet Model 0001')
.with_order(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.update_facet_model({
namespaceName="namespace-0001",
field="facet-model-0001",
type="gs2",
displayName="Sample Facet Model 0001",
order=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('log')
api_result_handler = client.update_facet_model_async({
namespaceName="namespace-0001",
field="facet-model-0001",
type="gs2",
displayName="Sample Facet Model 0001",
order=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;deleteFacetModel
패싯 모델 삭제
지정된 패싯 모델을 삭제합니다. 삭제된 패싯 모델은 로그 쿼리에서의 분류에 사용할 수 없게 됩니다.
상세
Request
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128자 | 네임스페이스 이름 네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. | ||
| field | string | ✓ | ~ 128자 | 패싯 필드 이름 이 패싯이 대상으로 하는 로그 필드의 이름입니다(예: “service”, “method”, “status”). |
Result
| 타입 | 설명 | |
|---|---|---|
| item | FacetModel | 삭제한 패싯 모델 |
구현 예제
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/log"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := log.Gs2LogRestClient{
Session: &session,
}
result, err := client.DeleteFacetModel(
&log.DeleteFacetModelRequest {
NamespaceName: pointy.String("namespace-0001"),
Field: pointy.String("facet-model-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\DeleteFacetModelRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->deleteFacetModel(
(new DeleteFacetModelRequest())
->withNamespaceName("namespace-0001")
->withField("facet-model-0001")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.DeleteFacetModelRequest;
import io.gs2.log.result.DeleteFacetModelResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
DeleteFacetModelResult result = client.deleteFacetModel(
new DeleteFacetModelRequest()
.withNamespaceName("namespace-0001")
.withField("facet-model-0001")
);
FacetModel item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.DeleteFacetModelResult> asyncResult = null;
yield return client.DeleteFacetModel(
new Gs2.Gs2Log.Request.DeleteFacetModelRequest()
.WithNamespaceName("namespace-0001")
.WithField("facet-model-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.deleteFacetModel(
new Gs2Log.DeleteFacetModelRequest()
.withNamespaceName("namespace-0001")
.withField("facet-model-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.delete_facet_model(
log.DeleteFacetModelRequest()
.with_namespace_name('namespace-0001')
.with_field('facet-model-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.delete_facet_model({
namespaceName="namespace-0001",
field="facet-model-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('log')
api_result_handler = client.delete_facet_model_async({
namespaceName="namespace-0001",
field="facet-model-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;queryMetricsTimeseries
타임시리즈 쿼리(Metrics)
설정 가능한 집계, 그룹화, 간격으로 메트릭에서 타임시리즈 데이터를 쿼리합니다.
여러 집계 설정, 다차원 분석을 위한 groupBy 레이블, 값 또는 이름에 의한 오름차순/내림차순 정렬을 지원합니다. 데이터 포인트의 최대 개수는 1500개이며, 이 제한을 초과하는 요청은 거부됩니다.
상세
Request
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128자 | 네임스페이스 이름 네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. | ||||||||
| begin | long | 현재 시각으로부터 1시간 전의 절대 시각 | 검색 범위 시작 일시 | |||||||||
| end | long | 현재 시각 | 검색 범위 종료 일시 | |||||||||
| query | string | ~ 10240자 | 검색 쿼리 문자열 | |||||||||
| groupBy | List<string> | [] | 0 ~ 10 items | 그룹화할 필드 | ||||||||
| aggregations | List<AggregationConfig> | [] | 0 ~ 10 items | 집계 설정 목록 | ||||||||
| interval | int | 60000 | 1000 ~ 86400000 | 집계 간격(밀리초) | ||||||||
| seriesLimit | int | 10 | 1 ~ 1000 | 가져올 시리즈 수 | ||||||||
| orderKey | 문자열 열거형 enum { “value”, “name” } | “value” | 정렬 키
| |||||||||
| orderBy | 문자열 열거형 enum { “asc”, “desc” } | “desc” | 정렬 순서
|
Result
| 타입 | 설명 | |
|---|---|---|
| items | List<TimeseriesPoint> | 타임시리즈 값 목록 |
| timeseriesMetadata | TimeseriesMetadata | 타임시리즈의 메타데이터 |
구현 예제
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/log"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := log.Gs2LogRestClient{
Session: &session,
}
result, err := client.QueryMetricsTimeseries(
&log.QueryMetricsTimeseriesRequest {
NamespaceName: pointy.String("namespace-0001"),
Begin: nil,
End: nil,
Query: nil,
GroupBy: nil,
Aggregations: nil,
Interval: nil,
SeriesLimit: nil,
OrderKey: nil,
OrderBy: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
timeseriesMetadata := result.TimeseriesMetadatause Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\QueryMetricsTimeseriesRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->queryMetricsTimeseries(
(new QueryMetricsTimeseriesRequest())
->withNamespaceName("namespace-0001")
->withBegin(null)
->withEnd(null)
->withQuery(null)
->withGroupBy(null)
->withAggregations(null)
->withInterval(null)
->withSeriesLimit(null)
->withOrderKey(null)
->withOrderBy(null)
);
$items = $result->getItems();
$timeseriesMetadata = $result->getTimeseriesMetadata();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.QueryMetricsTimeseriesRequest;
import io.gs2.log.result.QueryMetricsTimeseriesResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
QueryMetricsTimeseriesResult result = client.queryMetricsTimeseries(
new QueryMetricsTimeseriesRequest()
.withNamespaceName("namespace-0001")
.withBegin(null)
.withEnd(null)
.withQuery(null)
.withGroupBy(null)
.withAggregations(null)
.withInterval(null)
.withSeriesLimit(null)
.withOrderKey(null)
.withOrderBy(null)
);
List<TimeseriesPoint> items = result.getItems();
TimeseriesMetadata timeseriesMetadata = result.getTimeseriesMetadata();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.QueryMetricsTimeseriesResult> asyncResult = null;
yield return client.QueryMetricsTimeseries(
new Gs2.Gs2Log.Request.QueryMetricsTimeseriesRequest()
.WithNamespaceName("namespace-0001")
.WithBegin(null)
.WithEnd(null)
.WithQuery(null)
.WithGroupBy(null)
.WithAggregations(null)
.WithInterval(null)
.WithSeriesLimit(null)
.WithOrderKey(null)
.WithOrderBy(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var timeseriesMetadata = result.TimeseriesMetadata;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.queryMetricsTimeseries(
new Gs2Log.QueryMetricsTimeseriesRequest()
.withNamespaceName("namespace-0001")
.withBegin(null)
.withEnd(null)
.withQuery(null)
.withGroupBy(null)
.withAggregations(null)
.withInterval(null)
.withSeriesLimit(null)
.withOrderKey(null)
.withOrderBy(null)
);
const items = result.getItems();
const timeseriesMetadata = result.getTimeseriesMetadata();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.query_metrics_timeseries(
log.QueryMetricsTimeseriesRequest()
.with_namespace_name('namespace-0001')
.with_begin(None)
.with_end(None)
.with_query(None)
.with_group_by(None)
.with_aggregations(None)
.with_interval(None)
.with_series_limit(None)
.with_order_key(None)
.with_order_by(None)
)
items = result.items
timeseries_metadata = result.timeseries_metadata
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.query_metrics_timeseries({
namespaceName="namespace-0001",
begin=nil,
end=nil,
query=nil,
groupBy=nil,
aggregations=nil,
interval=nil,
seriesLimit=nil,
orderKey=nil,
orderBy=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
timeseriesMetadata = result.timeseriesMetadata;client = gs2('log')
api_result_handler = client.query_metrics_timeseries_async({
namespaceName="namespace-0001",
begin=nil,
end=nil,
query=nil,
groupBy=nil,
aggregations=nil,
interval=nil,
seriesLimit=nil,
orderKey=nil,
orderBy=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
timeseriesMetadata = result.timeseriesMetadata;describeMetrics
메트릭 모델 목록 조회
지정된 네임스페이스에서 사용 가능한 메트릭 모델의 페이지네이션 목록을 가져옵니다.
메트릭 모델은 타임시리즈 API로 쿼리할 수 있는 내장 메트릭을 정의합니다. 이름 접두사로 필터링할 수 있습니다.
상세
Request
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128자 | 네임스페이스 이름 네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. | ||
| namePrefix | string | ~ 64자 | 메트릭 모델 이름 필터 접두사 | |||
| pageToken | string | ~ 1024자 | 데이터 취득을 시작할 위치를 지정하는 토큰 | |||
| limit | int | 30 | 1 ~ 1000 | 취득할 데이터 건수 |
Result
| 타입 | 설명 | |
|---|---|---|
| items | List<MetricModel> | 메트릭 모델 목록 |
| nextPageToken | string | 목록의 나머지를 취득하기 위한 페이지 토큰 |
구현 예제
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/log"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := log.Gs2LogRestClient{
Session: &session,
}
result, err := client.DescribeMetrics(
&log.DescribeMetricsRequest {
NamespaceName: pointy.String("namespace-0001"),
NamePrefix: nil,
PageToken: nil,
Limit: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageTokenuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\DescribeMetricsRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->describeMetrics(
(new DescribeMetricsRequest())
->withNamespaceName("namespace-0001")
->withNamePrefix(null)
->withPageToken(null)
->withLimit(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.DescribeMetricsRequest;
import io.gs2.log.result.DescribeMetricsResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
DescribeMetricsResult result = client.describeMetrics(
new DescribeMetricsRequest()
.withNamespaceName("namespace-0001")
.withNamePrefix(null)
.withPageToken(null)
.withLimit(null)
);
List<MetricModel> items = result.getItems();
String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.DescribeMetricsResult> asyncResult = null;
yield return client.DescribeMetrics(
new Gs2.Gs2Log.Request.DescribeMetricsRequest()
.WithNamespaceName("namespace-0001")
.WithNamePrefix(null)
.WithPageToken(null)
.WithLimit(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.describeMetrics(
new Gs2Log.DescribeMetricsRequest()
.withNamespaceName("namespace-0001")
.withNamePrefix(null)
.withPageToken(null)
.withLimit(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.describe_metrics(
log.DescribeMetricsRequest()
.with_namespace_name('namespace-0001')
.with_name_prefix(None)
.with_page_token(None)
.with_limit(None)
)
items = result.items
next_page_token = result.next_page_token
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.describe_metrics({
namespaceName="namespace-0001",
namePrefix=nil,
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;client = gs2('log')
api_result_handler = client.describe_metrics_async({
namespaceName="namespace-0001",
namePrefix=nil,
pageToken=nil,
limit=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;describeLabelValues
특정 메트릭의 레이블 값 목록 조회
특정 메트릭에서 사용 가능한 레이블 값을 가져옵니다.
레이블 값은 타임시리즈 쿼리의 groupBy 필드나 필터로 사용할 수 있습니다. 레이블 이름 접두사로 필터링할 수 있습니다.
상세
Request
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128자 | 네임스페이스 이름 네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. | ||
| metricName | string | ✓ | ~ 128자 | 필터링 대상 메트릭 이름 | ||
| labelNamePrefix | string | ~ 64자 | 레이블 이름 필터 접두사 | |||
| pageToken | string | ~ 1024자 | 데이터 취득을 시작할 위치를 지정하는 토큰 | |||
| limit | int | 30 | 1 ~ 1000 | 취득할 데이터 건수 |
Result
| 타입 | 설명 | |
|---|---|---|
| items | List<Label> | 레이블 값 목록 |
| nextPageToken | string | 목록의 나머지를 취득하기 위한 페이지 토큰 |
구현 예제
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/log"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := log.Gs2LogRestClient{
Session: &session,
}
result, err := client.DescribeLabelValues(
&log.DescribeLabelValuesRequest {
NamespaceName: pointy.String("namespace-0001"),
MetricName: pointy.String("metric"),
LabelNamePrefix: nil,
PageToken: nil,
Limit: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageTokenuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\DescribeLabelValuesRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->describeLabelValues(
(new DescribeLabelValuesRequest())
->withNamespaceName("namespace-0001")
->withMetricName("metric")
->withLabelNamePrefix(null)
->withPageToken(null)
->withLimit(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.DescribeLabelValuesRequest;
import io.gs2.log.result.DescribeLabelValuesResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
DescribeLabelValuesResult result = client.describeLabelValues(
new DescribeLabelValuesRequest()
.withNamespaceName("namespace-0001")
.withMetricName("metric")
.withLabelNamePrefix(null)
.withPageToken(null)
.withLimit(null)
);
List<Label> items = result.getItems();
String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.DescribeLabelValuesResult> asyncResult = null;
yield return client.DescribeLabelValues(
new Gs2.Gs2Log.Request.DescribeLabelValuesRequest()
.WithNamespaceName("namespace-0001")
.WithMetricName("metric")
.WithLabelNamePrefix(null)
.WithPageToken(null)
.WithLimit(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.describeLabelValues(
new Gs2Log.DescribeLabelValuesRequest()
.withNamespaceName("namespace-0001")
.withMetricName("metric")
.withLabelNamePrefix(null)
.withPageToken(null)
.withLimit(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.describe_label_values(
log.DescribeLabelValuesRequest()
.with_namespace_name('namespace-0001')
.with_metric_name('metric')
.with_label_name_prefix(None)
.with_page_token(None)
.with_limit(None)
)
items = result.items
next_page_token = result.next_page_token
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.describe_label_values({
namespaceName="namespace-0001",
metricName="metric",
labelNamePrefix=nil,
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;client = gs2('log')
api_result_handler = client.describe_label_values_async({
namespaceName="namespace-0001",
metricName="metric",
labelNamePrefix=nil,
pageToken=nil,
limit=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;queryLog
로그 엔트리 쿼리(v2)
v2 로그 쿼리 API를 사용하여 로그 엔트리를 쿼리합니다. 전문 검색을 통한 필터링이 가능합니다.
쿼리 문자열에 의한 필터링을 지원하며, 총 엔트리 수를 반환합니다(10000건을 초과하는 경우 10001이 반환됩니다).
상세
Request
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128자 | 네임스페이스 이름 네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. | ||
| begin | long | 현재 시각으로부터 1시간 전의 절대 시각 | 검색 범위 시작 일시 | |||
| end | long | 현재 시각 | 검색 범위 종료 일시 | |||
| query | string | ~ 10240자 | 검색 쿼리 문자열 | |||
| pageToken | string | ~ 1024자 | 데이터 취득을 시작할 위치를 지정하는 토큰 | |||
| limit | int | 30 | 1 ~ 1000 | 취득할 데이터 건수 |
Result
| 타입 | 설명 | |
|---|---|---|
| items | List<LogEntry> | 액세스 로그 목록 |
| totalEntryCount | int | 쿼리 결과의 총 건수(10000건을 초과하는 경우 10001이 반환됩니다) |
| nextPageToken | string | 목록의 나머지를 취득하기 위한 페이지 토큰 |
구현 예제
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/log"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := log.Gs2LogRestClient{
Session: &session,
}
result, err := client.QueryLog(
&log.QueryLogRequest {
NamespaceName: pointy.String("namespace-0001"),
Begin: nil,
End: nil,
Query: nil,
PageToken: nil,
Limit: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
totalEntryCount := result.TotalEntryCount
nextPageToken := result.NextPageTokenuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\QueryLogRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->queryLog(
(new QueryLogRequest())
->withNamespaceName("namespace-0001")
->withBegin(null)
->withEnd(null)
->withQuery(null)
->withPageToken(null)
->withLimit(null)
);
$items = $result->getItems();
$totalEntryCount = $result->getTotalEntryCount();
$nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.QueryLogRequest;
import io.gs2.log.result.QueryLogResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
QueryLogResult result = client.queryLog(
new QueryLogRequest()
.withNamespaceName("namespace-0001")
.withBegin(null)
.withEnd(null)
.withQuery(null)
.withPageToken(null)
.withLimit(null)
);
List<LogEntry> items = result.getItems();
int totalEntryCount = result.getTotalEntryCount();
String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.QueryLogResult> asyncResult = null;
yield return client.QueryLog(
new Gs2.Gs2Log.Request.QueryLogRequest()
.WithNamespaceName("namespace-0001")
.WithBegin(null)
.WithEnd(null)
.WithQuery(null)
.WithPageToken(null)
.WithLimit(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var totalEntryCount = result.TotalEntryCount;
var nextPageToken = result.NextPageToken;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.queryLog(
new Gs2Log.QueryLogRequest()
.withNamespaceName("namespace-0001")
.withBegin(null)
.withEnd(null)
.withQuery(null)
.withPageToken(null)
.withLimit(null)
);
const items = result.getItems();
const totalEntryCount = result.getTotalEntryCount();
const nextPageToken = result.getNextPageToken();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.query_log(
log.QueryLogRequest()
.with_namespace_name('namespace-0001')
.with_begin(None)
.with_end(None)
.with_query(None)
.with_page_token(None)
.with_limit(None)
)
items = result.items
total_entry_count = result.total_entry_count
next_page_token = result.next_page_token
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.query_log({
namespaceName="namespace-0001",
begin=nil,
end=nil,
query=nil,
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
totalEntryCount = result.totalEntryCount;
nextPageToken = result.nextPageToken;client = gs2('log')
api_result_handler = client.query_log_async({
namespaceName="namespace-0001",
begin=nil,
end=nil,
query=nil,
pageToken=nil,
limit=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
totalEntryCount = result.totalEntryCount;
nextPageToken = result.nextPageToken;getLog
요청 ID를 지정하여 로그 엔트리 조회
지정된 시간 범위 내의 특정 로그 엔트리를 요청 ID로 조회합니다.
요청 ID는 단일 API 호출 로그 엔트리를 고유하게 식별합니다.
상세
Request
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128자 | 네임스페이스 이름 네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. | ||
| logRequestId | string | ✓ | ~ 128자 | 요청 ID | ||
| begin | long | 현재 시각으로부터 1시간 전의 절대 시각 | 검색 범위 시작 일시 | |||
| end | long | 현재 시각 | 검색 범위 종료 일시 |
Result
| 타입 | 설명 | |
|---|---|---|
| item | LogEntry | 액세스 로그 |
구현 예제
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/log"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := log.Gs2LogRestClient{
Session: &session,
}
result, err := client.GetLog(
&log.GetLogRequest {
NamespaceName: pointy.String("namespace-0001"),
LogRequestId: pointy.String("requestId-0001"),
Begin: nil,
End: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\GetLogRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->getLog(
(new GetLogRequest())
->withNamespaceName("namespace-0001")
->withLogRequestId("requestId-0001")
->withBegin(null)
->withEnd(null)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.GetLogRequest;
import io.gs2.log.result.GetLogResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
GetLogResult result = client.getLog(
new GetLogRequest()
.withNamespaceName("namespace-0001")
.withLogRequestId("requestId-0001")
.withBegin(null)
.withEnd(null)
);
LogEntry item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.GetLogResult> asyncResult = null;
yield return client.GetLog(
new Gs2.Gs2Log.Request.GetLogRequest()
.WithNamespaceName("namespace-0001")
.WithLogRequestId("requestId-0001")
.WithBegin(null)
.WithEnd(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.getLog(
new Gs2Log.GetLogRequest()
.withNamespaceName("namespace-0001")
.withLogRequestId("requestId-0001")
.withBegin(null)
.withEnd(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.get_log(
log.GetLogRequest()
.with_namespace_name('namespace-0001')
.with_log_request_id('requestId-0001')
.with_begin(None)
.with_end(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.get_log({
namespaceName="namespace-0001",
logRequestId="requestId-0001",
begin=nil,
end=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('log')
api_result_handler = client.get_log_async({
namespaceName="namespace-0001",
logRequestId="requestId-0001",
begin=nil,
end=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;queryFacets
패싯 쿼리
지정된 시간 범위 내의 로그 엔트리에 대한 패싯(분류) 데이터를 가져옵니다.
내장 패싯(service, function, status, duration)과 네임스페이스에 정의된 커스텀 패싯 모델을 모두 반환합니다. 쿼리 문자열에 의한 필터링으로 패싯 범위를 좁힐 수 있습니다.
상세
Request
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128자 | 네임스페이스 이름 네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. | ||
| begin | long | 현재 시각으로부터 1시간 전의 절대 시각 | 검색 범위 시작 일시 | |||
| end | long | 현재 시각 | 검색 범위 종료 일시 | |||
| query | string | ~ 10240자 | 검색 쿼리 문자열 |
Result
| 타입 | 설명 | |
|---|---|---|
| items | List<Facet> | 패싯 목록 |
구현 예제
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/log"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := log.Gs2LogRestClient{
Session: &session,
}
result, err := client.QueryFacets(
&log.QueryFacetsRequest {
NamespaceName: pointy.String("namespace-0001"),
Begin: nil,
End: nil,
Query: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Itemsuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\QueryFacetsRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->queryFacets(
(new QueryFacetsRequest())
->withNamespaceName("namespace-0001")
->withBegin(null)
->withEnd(null)
->withQuery(null)
);
$items = $result->getItems();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.QueryFacetsRequest;
import io.gs2.log.result.QueryFacetsResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
QueryFacetsResult result = client.queryFacets(
new QueryFacetsRequest()
.withNamespaceName("namespace-0001")
.withBegin(null)
.withEnd(null)
.withQuery(null)
);
List<Facet> items = result.getItems();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.QueryFacetsResult> asyncResult = null;
yield return client.QueryFacets(
new Gs2.Gs2Log.Request.QueryFacetsRequest()
.WithNamespaceName("namespace-0001")
.WithBegin(null)
.WithEnd(null)
.WithQuery(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.queryFacets(
new Gs2Log.QueryFacetsRequest()
.withNamespaceName("namespace-0001")
.withBegin(null)
.withEnd(null)
.withQuery(null)
);
const items = result.getItems();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.query_facets(
log.QueryFacetsRequest()
.with_namespace_name('namespace-0001')
.with_begin(None)
.with_end(None)
.with_query(None)
)
items = result.items
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.query_facets({
namespaceName="namespace-0001",
begin=nil,
end=nil,
query=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;client = gs2('log')
api_result_handler = client.query_facets_async({
namespaceName="namespace-0001",
begin=nil,
end=nil,
query=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;queryTimeseries
타임시리즈 쿼리(Log)
설정 가능한 집계, 그룹화, 간격으로 로그 엔트리에서 타임시리즈 데이터를 쿼리합니다.
다차원 분석을 위한 groupBy 필드와 단일 집계 설정을 지원합니다. 데이터 포인트의 최대 개수는 1500개이며, 이 제한을 초과하는 요청은 거부됩니다. 결과는 페이지네이션이 가능하며 시리즈 수를 제한할 수 있습니다.
상세
Request
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128자 | 네임스페이스 이름 네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. | ||
| begin | long | 현재 시각으로부터 1시간 전의 절대 시각 | 검색 범위 시작 일시 | |||
| end | long | 현재 시각 | 검색 범위 종료 일시 | |||
| query | string | ~ 10240자 | 검색 쿼리 문자열 | |||
| groupBy | List<string> | [] | 0 ~ 10 items | 그룹화할 필드 | ||
| aggregation | AggregationConfig | ✓ | 집계 설정 | |||
| interval | int | 60000 | 1000 ~ 86400000 | 집계 간격(밀리초) | ||
| seriesLimit | int | 10 | 1 ~ 1000 | 가져올 시리즈 수 | ||
| pageToken | string | ~ 1024자 | 데이터 취득을 시작할 위치를 지정하는 토큰 | |||
| limit | int | 30 | 1 ~ 1000 | 취득할 데이터 건수 |
Result
| 타입 | 설명 | |
|---|---|---|
| items | List<TimeseriesPoint> | 타임시리즈 값 목록 |
| timeseriesMetadata | TimeseriesMetadata | 타임시리즈의 메타데이터 |
| nextPageToken | string | 목록의 나머지를 취득하기 위한 페이지 토큰 |
구현 예제
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/log"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := log.Gs2LogRestClient{
Session: &session,
}
result, err := client.QueryTimeseries(
&log.QueryTimeseriesRequest {
NamespaceName: pointy.String("namespace-0001"),
Begin: nil,
End: nil,
Query: nil,
GroupBy: nil,
Aggregation: nil,
Interval: nil,
SeriesLimit: nil,
PageToken: nil,
Limit: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
timeseriesMetadata := result.TimeseriesMetadata
nextPageToken := result.NextPageTokenuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\QueryTimeseriesRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->queryTimeseries(
(new QueryTimeseriesRequest())
->withNamespaceName("namespace-0001")
->withBegin(null)
->withEnd(null)
->withQuery(null)
->withGroupBy(null)
->withAggregation(null)
->withInterval(null)
->withSeriesLimit(null)
->withPageToken(null)
->withLimit(null)
);
$items = $result->getItems();
$timeseriesMetadata = $result->getTimeseriesMetadata();
$nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.QueryTimeseriesRequest;
import io.gs2.log.result.QueryTimeseriesResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
QueryTimeseriesResult result = client.queryTimeseries(
new QueryTimeseriesRequest()
.withNamespaceName("namespace-0001")
.withBegin(null)
.withEnd(null)
.withQuery(null)
.withGroupBy(null)
.withAggregation(null)
.withInterval(null)
.withSeriesLimit(null)
.withPageToken(null)
.withLimit(null)
);
List<TimeseriesPoint> items = result.getItems();
TimeseriesMetadata timeseriesMetadata = result.getTimeseriesMetadata();
String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.QueryTimeseriesResult> asyncResult = null;
yield return client.QueryTimeseries(
new Gs2.Gs2Log.Request.QueryTimeseriesRequest()
.WithNamespaceName("namespace-0001")
.WithBegin(null)
.WithEnd(null)
.WithQuery(null)
.WithGroupBy(null)
.WithAggregation(null)
.WithInterval(null)
.WithSeriesLimit(null)
.WithPageToken(null)
.WithLimit(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var timeseriesMetadata = result.TimeseriesMetadata;
var nextPageToken = result.NextPageToken;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.queryTimeseries(
new Gs2Log.QueryTimeseriesRequest()
.withNamespaceName("namespace-0001")
.withBegin(null)
.withEnd(null)
.withQuery(null)
.withGroupBy(null)
.withAggregation(null)
.withInterval(null)
.withSeriesLimit(null)
.withPageToken(null)
.withLimit(null)
);
const items = result.getItems();
const timeseriesMetadata = result.getTimeseriesMetadata();
const nextPageToken = result.getNextPageToken();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.query_timeseries(
log.QueryTimeseriesRequest()
.with_namespace_name('namespace-0001')
.with_begin(None)
.with_end(None)
.with_query(None)
.with_group_by(None)
.with_aggregation(None)
.with_interval(None)
.with_series_limit(None)
.with_page_token(None)
.with_limit(None)
)
items = result.items
timeseries_metadata = result.timeseries_metadata
next_page_token = result.next_page_token
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.query_timeseries({
namespaceName="namespace-0001",
begin=nil,
end=nil,
query=nil,
groupBy=nil,
aggregation=nil,
interval=nil,
seriesLimit=nil,
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
timeseriesMetadata = result.timeseriesMetadata;
nextPageToken = result.nextPageToken;client = gs2('log')
api_result_handler = client.query_timeseries_async({
namespaceName="namespace-0001",
begin=nil,
end=nil,
query=nil,
groupBy=nil,
aggregation=nil,
interval=nil,
seriesLimit=nil,
pageToken=nil,
limit=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
timeseriesMetadata = result.timeseriesMetadata;
nextPageToken = result.nextPageToken;getTrace
트레이스 ID를 지정하여 트레이스 조회
지정된 시간 범위 내의 트레이스와 그에 관련된 로그 엔트리를 트레이스 ID로 조회합니다.
메인 트레이스와 병렬로 실행된 트레이스를 반환하며, 병렬 리스트가 잘렸는지 여부를 나타내는 플래그가 포함됩니다.
상세
Request
| 타입 | 활성화 조건 | 필수 | 기본값 | 값 제한 | 설명 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128자 | 네임스페이스 이름 네임스페이스 고유의 이름입니다. 영숫자 및 -(하이픈) _(언더스코어) .(마침표)로 지정합니다. | ||
| traceId | string | ✓ | UUID | ~ 36자 | 트레이스 ID 이 트레이스의 고유 식별자로, 요청 흐름 내의 모든 관련 로그 엔트리(스팬)에서 공유됩니다. | |
| begin | long | 현재 시각으로부터 1시간 전의 절대 시각 | 검색 범위 시작 일시 | |||
| end | long | 현재 시각 | 검색 범위 종료 일시 |
Result
| 타입 | 설명 | |
|---|---|---|
| trace | Trace | 트레이스 |
| parallels | List<Trace> | 병렬로 실행된 트레이스 목록 |
| parallelTruncated | bool | 병렬 리스트가 잘렸는지 여부를 나타냅니다 |
구현 예제
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/log"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := log.Gs2LogRestClient{
Session: &session,
}
result, err := client.GetTrace(
&log.GetTraceRequest {
NamespaceName: pointy.String("namespace-0001"),
TraceId: pointy.String("traceId-0001"),
Begin: nil,
End: nil,
}
)
if err != nil {
panic("error occurred")
}
trace := result.Trace
parallels := result.Parallels
parallelTruncated := result.ParallelTruncateduse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\GetTraceRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->getTrace(
(new GetTraceRequest())
->withNamespaceName("namespace-0001")
->withTraceId("traceId-0001")
->withBegin(null)
->withEnd(null)
);
$trace = $result->getTrace();
$parallels = $result->getParallels();
$parallelTruncated = $result->getParallelTruncated();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.GetTraceRequest;
import io.gs2.log.result.GetTraceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
GetTraceResult result = client.getTrace(
new GetTraceRequest()
.withNamespaceName("namespace-0001")
.withTraceId("traceId-0001")
.withBegin(null)
.withEnd(null)
);
Trace trace = result.getTrace();
List<Trace> parallels = result.getParallels();
boolean parallelTruncated = result.getParallelTruncated();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.GetTraceResult> asyncResult = null;
yield return client.GetTrace(
new Gs2.Gs2Log.Request.GetTraceRequest()
.WithNamespaceName("namespace-0001")
.WithTraceId("traceId-0001")
.WithBegin(null)
.WithEnd(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var trace = result.Trace;
var parallels = result.Parallels;
var parallelTruncated = result.ParallelTruncated;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.getTrace(
new Gs2Log.GetTraceRequest()
.withNamespaceName("namespace-0001")
.withTraceId("traceId-0001")
.withBegin(null)
.withEnd(null)
);
const trace = result.getTrace();
const parallels = result.getParallels();
const parallelTruncated = result.getParallelTruncated();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.get_trace(
log.GetTraceRequest()
.with_namespace_name('namespace-0001')
.with_trace_id('traceId-0001')
.with_begin(None)
.with_end(None)
)
trace = result.trace
parallels = result.parallels
parallel_truncated = result.parallel_truncated
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.get_trace({
namespaceName="namespace-0001",
traceId="traceId-0001",
begin=nil,
end=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
trace = result.trace;
parallels = result.parallels;
parallelTruncated = result.parallelTruncated;client = gs2('log')
api_result_handler = client.get_trace_async({
namespaceName="namespace-0001",
traceId="traceId-0001",
begin=nil,
end=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
trace = result.trace;
parallels = result.parallels;
parallelTruncated = result.parallelTruncated;