GS2-Log SDK API Reference

Specification of models and API references for GS2-Log SDK for various programming languages

Model

Namespace

Namespace

A Namespace allows multiple independent instances of the same service within a single project by separating data spaces and usage contexts. Each GS2 service is managed on a per-namespace basis. Even when using the same service, if the Namespace differs, the data is treated as a completely independent data space.

Therefore, you must create a Namespace before you can start using each service.

Details
TypeConditionRequiredDefaultValue LimitsDescription
namespaceIdstring
*
~ 1024 charsNamespace GRN
* Set automatically by the server
namestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
descriptionstring~ 1024 charsDescription
typeString Enum
enum {
  “gs2”,
  “bigquery”,
  “firehose”
}
“gs2”Log Export Method
Determines the destination for exported log data. “gs2” stores logs within GS2’s managed storage with built-in search and analysis capabilities. “bigquery” exports logs to Google BigQuery for advanced analytics. “firehose” streams logs to Amazon Kinesis Data Firehose for delivery to S3, Redshift, or other AWS destinations.
DefinitionDescription
“gs2”Management by GS2
“bigquery”Export to BigQuery
“firehose”Export to Kinesis Firehose
gcpCredentialJsonstring{type} == “bigquery”
✓*
~ 5120 charsGCP Credentials
GCP credential JSON for authenticating when exporting logs to BigQuery. The service account must have BigQuery Data Editor permissions on the target dataset.
* Required if type is “bigquery”
bigQueryDatasetNamestring{type} == “bigquery”
✓*
~ 1024 charsBigQuery Dataset Name
The name of the BigQuery dataset where log data will be exported. The dataset must already exist in the GCP project associated with the provided credentials.
* Required if type is “bigquery”
logExpireDaysint{type} in [“gs2”, “bigquery”]
✓*
0 ~ 3650Log Retention Period (days)
The number of days to retain log data. Logs older than this period are automatically deleted. Applicable when the export method is “gs2” or “bigquery”. Maximum 3650 days (approximately 10 years).
* Required if type is “gs2”,“bigquery”
awsRegionstring{type} == “firehose”
✓*
~ 256 charsAWS Region
The AWS region where the Kinesis Data Firehose delivery stream is located (e.g., us-east-1, ap-northeast-1).
* Required if type is “firehose”
awsAccessKeyIdstring{type} == “firehose”
✓*
~ 256 charsAWS Access Key ID
The AWS access key ID for authenticating with Kinesis Data Firehose. The IAM user must have permissions to put records to the specified Firehose delivery stream.
* Required if type is “firehose”
awsSecretAccessKeystring{type} == “firehose”
✓*
~ 256 charsAWS Secret Access Key
The AWS secret access key paired with the access key ID for Kinesis Data Firehose authentication.
* Required if type is “firehose”
firehoseStreamNamestring{type} == “firehose”
✓*
~ 256 charsKinesis Firehose Stream Name
The name of the Kinesis Data Firehose delivery stream to which log data is sent.
* Required if type is “firehose”
firehoseCompressDataString Enum
enum {
  “none”,
  “gzip”
}
{type} == “firehose”“none”Compress Data for Kinesis Firehose
Whether to compress log data before sending to Kinesis Data Firehose. Gzip compression reduces data transfer volume and storage costs.
DefinitionDescription
“none”Do not compress
“gzip”Gzip
* Applicable only if type is “firehose”
statusstring“ACTIVE”~ 128 charsStatus
The current operational status of this namespace. Indicates whether the namespace is active and accepting log data.
createdAtlong
*
NowDatetime of creation
Unix time, milliseconds
* Set automatically by the server
updatedAtlong
*
NowDatetime of last update
Unix time, milliseconds
* Set automatically by the server
revisionlong00 ~ 9223372036854775805Revision

AccessLog

Access log

This log records requests to microservices and their responses.

Details
TypeConditionRequiredDefaultValue LimitsDescription
timestamplong
Timestamp
The date and time when the API request was processed.
requestIdstring
~ 1024 charsRequest ID
A unique identifier assigned to each API request. Used for tracking and debugging specific API calls.
servicestring
~ 1024 charsMicroservice Type
The name of the GS2 microservice that handled the request (e.g., account, inventory, limit).
methodstring
~ 1024 charsMicroservice Method
The specific API method that was called on the microservice (e.g., createNamespace, getItem).
userIdstring~ 128 charsUser ID
requeststring
~ 10485760 charsRequest Content
The full request parameters sent to the API in JSON format.
resultstring
~ 10485760 charsResponse Content
The full response returned by the API in JSON format, including both successful results and error details.

AccessLogCount

Access Log Aggregation

An aggregated count of access log entries, grouped by microservice type, method, and user. Used for analyzing API usage patterns and identifying frequently called endpoints.

Details
TypeConditionRequiredDefaultValue LimitsDescription
servicestring~ 1024 charsMicroservice Type
The name of the GS2 microservice. Used as a grouping key for aggregation.
methodstring~ 1024 charsMicroservice Method
The specific API method. Used as a grouping key for aggregation.
userIdstring~ 128 charsUser ID
countlong
0 ~ 9223372036854775805Count
The total number of access log entries matching the grouping criteria.

IssueStampSheetLog

Issued Transaction Log

Records the issuance of distributed transactions. Each entry captures the acquire action and associated consume actions (tasks) that were packaged together as a single transaction at the time of issuance.

Details
TypeConditionRequiredDefaultValue LimitsDescription
timestamplong
Timestamp
The date and time when the transaction was issued.
transactionIdstring
~ 1024 charsTransaction ID
The unique identifier of the issued distributed transaction.
servicestring
~ 1024 charsMicroservice Type
The name of the GS2 microservice that issued the transaction.
methodstring
~ 1024 charsMicroservice Method
The specific API method that triggered the transaction issuance.
userIdstring
~ 128 charsUser ID
actionstring
~ 1024 charsAcquire Action
The acquire action included in the transaction, specifying what the user will receive upon execution.
argsstring
~ 5242880 charsArguments
The parameters for the acquire action in JSON format.
tasksList<string>0 ~ 10 itemsList of Consume Actions
The consume actions that are bundled with this transaction. These are executed before the acquire action to consume resources as preconditions.

IssueStampSheetLogCount

Issued Transaction Log Aggregation

An aggregated count of transaction issuance log entries, grouped by microservice type, method, user, and action. Used for analyzing the volume and distribution of distributed transactions issued across services.

Details
TypeConditionRequiredDefaultValue LimitsDescription
servicestring~ 1024 charsMicroservice Type
The name of the GS2 microservice that issued the transaction.
methodstring~ 1024 charsMicroservice Method
The specific API method that triggered the transaction issuance.
userIdstring~ 128 charsUser ID
actionstring~ 1024 charsAcquire Action
The type of acquire action included in the issued transaction.
countlong
0 ~ 9223372036854775805Count
The total number of transaction issuance log entries matching the grouping criteria.

ExecuteStampSheetLog

Transaction Execution Log

This is a log of the execution details of the transaction for each microservice.

Details
TypeConditionRequiredDefaultValue LimitsDescription
timestamplong
Timestamp
The date and time when the acquire action was executed.
transactionIdstring
~ 1024 charsTransaction ID
The unique identifier of the distributed transaction that this acquire action belongs to.
servicestring
~ 1024 charsMicroservice Type
The name of the GS2 microservice that executed the acquire action (e.g., inventory, experience).
methodstring
~ 1024 charsMicroservice Method
The specific method invoked on the microservice to execute the acquire action.
userIdstring
~ 128 charsUser ID
actionstring
~ 1024 charsAcquire Action
The type of acquire action that was executed (e.g., Gs2Inventory:AcquireItemSetByUserId, Gs2Experience:AddExperienceByUserId).
argsstring
~ 5242880 charsArguments
The parameters passed to the acquire action in JSON format.

ExecuteStampSheetLogCount

Acquire Action Execution Log Aggregation

An aggregated count of acquire action execution log entries, grouped by microservice type, method, user, and action. Used for analyzing how frequently each type of acquire action is being executed.

Details
TypeConditionRequiredDefaultValue LimitsDescription
servicestring~ 1024 charsMicroservice Type
The name of the GS2 microservice that executed the acquire action.
methodstring~ 1024 charsMicroservice Method
The specific method invoked to execute the acquire action.
userIdstring~ 128 charsUser ID
actionstring~ 1024 charsAcquire Action
The type of acquire action that was executed.
countlong
0 ~ 9223372036854775805Count
The total number of acquire action execution log entries matching the grouping criteria.

ExecuteStampTaskLog

Consume Action Execution Log

This is a log of the execution details of the consume action for each microservice.

Details
TypeConditionRequiredDefaultValue LimitsDescription
timestamplong
Timestamp
The date and time when the consume action was executed.
taskIdstring
~ 1024 charsTask ID
The unique identifier of the transaction that was executed.
servicestring
~ 1024 charsMicroservice Type
The name of the GS2 microservice that executed the consume action (e.g., inventory, money).
methodstring
~ 1024 charsMicroservice Method
The specific method invoked on the microservice to execute the consume action.
userIdstring
~ 128 charsUser ID
actionstring
~ 1024 charsConsume Action
The type of consume action that was executed (e.g., Gs2Inventory:ConsumeItemSetByUserId, Gs2Money:WithdrawByUserId).
argsstring
~ 5242880 charsArguments
The parameters passed to the consume action in JSON format.

ExecuteStampTaskLogCount

Consume Action Execution Log Aggregation

An aggregated count of consume action execution log entries, grouped by microservice type, method, user, and action. Used for analyzing how frequently each type of consume action is being executed.

Details
TypeConditionRequiredDefaultValue LimitsDescription
servicestring~ 1024 charsMicroservice Type
The name of the GS2 microservice that executed the consume action.
methodstring~ 1024 charsMicroservice Method
The specific method invoked to execute the consume action.
userIdstring~ 128 charsUser ID
actionstring~ 1024 charsConsume Action
The type of consume action that was executed.
countlong
0 ~ 9223372036854775805Count
The total number of consume action execution log entries matching the grouping criteria.

InGameLog

In-game Log

A custom log entry sent from the game client or server-side scripts. Unlike access logs which are automatically generated by GS2 API calls, in-game logs are explicitly sent by game developers to record game-specific events such as player actions, game state changes, or business metrics.

Details
TypeConditionRequiredDefaultValue LimitsDescription
timestamplong
Timestamp
The date and time when the in-game log was sent.
requestIdstring
~ 1024 charsRequest ID
A unique identifier assigned to this log entry for deduplication and tracking.
userIdstring~ 128 charsUser ID
tagsList<InGameLogTag>[]0 ~ 20 itemsTags
Key-value pairs attached to the log entry for filtering and categorization. Tags enable efficient searching and aggregation of in-game logs (e.g., event type, stage ID, item category).
payloadstring
~ 10485760 charsPayload
The custom log data in JSON format. Can contain any game-specific information such as player actions, game state, or business metrics. Maximum 10MB.

AccessLogWithTelemetry

Access log with telemetry information

This log records requests to microservices and their responses. The log includes response time and context information of the caller.

Details
TypeConditionRequiredDefaultValue LimitsDescription
timestamplong
Timestamp
The date and time when the API request was processed.
sourceRequestIdstring
~ 1024 charsSource Request ID
The request ID of the original caller that triggered this request. Used to trace related API calls back to the originating request.
requestIdstring
~ 1024 charsRequest ID
A unique identifier assigned to this specific API request.
durationlong
0 ~ 9223372036854775805Duration (ms)
The time in milliseconds taken to process this API request from receipt to response.
servicestring
~ 1024 charsMicroservice Type
The name of the GS2 microservice that handled the request (e.g., account, inventory, limit).
methodstring
~ 1024 charsMicroservice Method
The specific API method that was called on the microservice (e.g., createNamespace, getItem).
userIdstring~ 128 charsUser ID
requeststring
~ 10485760 charsRequest Content
The full request parameters sent to the API in JSON format.
resultstring
~ 10485760 charsResponse Content
The full response returned by the API in JSON format.
statusString Enum
enum {
  “ok”,
  “error”
}
Status
The result status of the API request. “ok” indicates successful processing, “error” indicates a failure occurred.
DefinitionDescription
“ok”OK
“error”Error

Insight

GS2-Insight is a tool for visualizing and analyzing access logs stored in GS2-Log. GS2-Insight itself is open source and available on github. https://github.com/gs2io/gs2-insight

Here, you can launch and use the publicly available open source code on-demand without hosting it yourself. GS2-Insight activated on demand can be used for up to 2 hours. If you wish to use it for more than 2 hours, please host it yourself.

Details
TypeConditionRequiredDefaultValue LimitsDescription
insightIdstring
*
~ 1024 charsGS2-Insight GRN
* Set automatically by the server
namestring
UUID~ 36 charsName
taskIdstring~ 128 charsTask ID
hoststring~ 256 charsHost Name
passwordstring
~ 32 charsPassword
statusString Enum
enum {
  “ALLOCATING”,
  “LAUNCHING”,
  “ACTIVE”,
  “DELETED”
}
“ALLOCATING”Status
DefinitionDescription
“ALLOCATING”Server assignment in progress
“LAUNCHING”during startup
“ACTIVE”Active
“DELETED”Deleted
createdAtlong
*
NowDatetime of creation
Unix time, milliseconds
* Set automatically by the server
revisionlong00 ~ 9223372036854775805Revision

Dashboard

Dashboard

A customizable dashboard for visualizing log data and metrics. Each dashboard stores its layout and widget configuration as a JSON payload, allowing users to create tailored views of their log analytics.

Details
TypeConditionRequiredDefaultValue LimitsDescription
dashboardIdstring
*
~ 1024 charsDashboard GRN
* Set automatically by the server
namestring
UUID~ 36 charsDashboard Name
displayNamestring
~ 256 charsDisplay Name
A human-readable name for this dashboard, shown in the dashboard list and header.
descriptionstring~ 1024 charsDescription
payloadstring
~ 1048576 charsPayload
The dashboard configuration in JSON format, containing widget definitions, layout information, query settings, and visualization options.
createdAtlong
*
NowDatetime of creation
Unix time, milliseconds
* Set automatically by the server
updatedAtlong
*
NowDatetime of last update
Unix time, milliseconds
* Set automatically by the server

FacetModel

Facet Model

Defines a facet field available for filtering and aggregating log data. Facets allow users to narrow down log search results by specific dimensions such as service name, method, status, or custom fields.

Details
TypeConditionRequiredDefaultValue LimitsDescription
facetModelIdstring
*
~ 1024 charsFacet Model GRN
* Set automatically by the server
fieldstring
~ 128 charsFacet Field Name
The name of the log field that this facet operates on (e.g., “service”, “method”, “status”).
typeString Enum
enum {
  “string”,
  “double”,
  “measure”
}
Facet Data Type
The data type of the facet field. “string” for categorical values with value counts, “double” for numeric values with range filtering, “measure” for measurement values with statistical analysis.
DefinitionDescription
“string”String
“double”Double
“measure”Measure
displayNamestring
~ 128 charsDisplay Name
A human-readable name for this facet, shown in the log search UI.
orderint00 ~ 100000Display Order
The sort order for displaying this facet in the UI. Lower values appear first.

MetricModel

Metric Model

Defines a metric that can be monitored and visualized. Predefined metrics include request count, request duration, and error rates (4xx/5xx) for each GS2 microservice. Each metric has associated labels for grouping and filtering.

Details
TypeConditionRequiredDefaultValue LimitsDescription
namestring
~ 128 charsMetric Name
The unique identifier for this metric (e.g., “RequestCount”, “RequestDuration”, “Error4xxCount”, “Error5xxCount”). Service-specific metrics are prefixed with the service name.
typeString Enum
enum {
  “string”,
  “double”,
  “measure”
}
Metric Data Type
The data type of the metric values. “double” is used for numeric counts, “measure” is used for duration/latency measurements.
DefinitionDescription
“string”String
“double”Double
“measure”Measure
labelsList<string>[]0 ~ 10 itemsLabels
The label names associated with this metric, used for grouping and filtering metric data (e.g., “service”, “method”, “namespaceName”). Labels define the dimensions along which the metric can be broken down.

AggregationConfig

Aggregation Config

Configuration for how log data or metrics should be aggregated when querying timeseries data. Specifies the aggregation function (count, average, percentile, etc.) and the target field to aggregate.

Details
TypeConditionRequiredDefaultValue LimitsDescription
typeString Enum
enum {
  “count”,
  “unique”,
  “sum”,
  “avg”,
  “max”,
  “min”,
  “p90”,
  “p95”,
  “p99”
}
“count”Aggregation type:
- unique: Unique value count
- avg: Average
- max: Maximum
- min: Minimum
- p90: 90th percentile
- p99: 99th percentile
DefinitionDescription
“count”Record count
“unique”Unique value count
“sum”Sum
“avg”Average
“max”Maximum
“min”Minimum
“p90”90th percentile
“p95”95th percentile
“p99”99th percentile
fieldstring~ 128 charsTarget field for aggregation (required except for count)

Facet

Facet

The result of a facet query on log data, containing the distribution of values for a specific field. For string fields, provides value counts; for numeric fields, provides the value range under current filters and the global range for UI slider display.

Details
TypeConditionRequiredDefaultValue LimitsDescription
fieldstring
~ 128 charsFacet Field Name
valuesList<FacetValueCount>[]0 ~ 100 itemsArray of values and counts for string facets
rangeNumericRangeNumeric range under current filter conditions
globalRangeNumericRangeFull data range before filters (for UI slider range)

FacetValueCount

Facet Value Count

A single value and its occurrence count within a string facet result. Represents how many log entries have a specific value for a given facet field.

Details
TypeConditionRequiredDefaultValue LimitsDescription
valuestring
~ 256 charsFacet Value
countlong
0 ~ 9223372036854775805Count of logs with this value

Label

Label

A key-value pair used to annotate log entries and metrics for categorization, filtering, and grouping.

Details
TypeConditionRequiredDefaultValue LimitsDescription
keystring
~ 128 charsLabel Key
The key name for this label (e.g., “service”, “method”, “namespaceName”).
valuestring
~ 256 charsLabel Value
The value for this label corresponding to the key.

LogEntry

Log Entry

A single log record within a trace, representing one processing step or API call. Contains the raw log data, processing duration, severity status, and associated labels for categorization.

Details
TypeConditionRequiredDefaultValue LimitsDescription
timestamplong
Timestamp
The date and time when this log entry was recorded.
statusString Enum
enum {
  “ok”,
  “info”,
  “notice”,
  “error”,
  “warn”,
  “emag”
}
Status
The severity level of this log entry, ranging from informational to emergency.
DefinitionDescription
“ok”OK
“info”Information
“notice”Notice
“error”Error
“warn”Warning
“emag”Emergency
durationlong00 ~ 9223372036854775805Duration (nanoseconds)
The processing time for this log entry in nanoseconds.
linestring
~ 10485760 charsRaw Log Line Data
The raw log data in JSON format, containing the full details of the processing step including request/response information.
labelsList<Label>[]0 ~ 128 itemsLabels
Key-value pairs attached to this log entry for categorization and filtering (e.g., service name, method, request ID).

NumericRange

Numeric range.

  • range: Range under current filter conditions (other filters applied, self excluded)
  • globalRange: Full data range before filters (used for UI slider range)
Details
TypeConditionRequiredDefaultValue LimitsDescription
mindouble
0 ~ 281474976710654Minimum Value
maxdouble
0 ~ 281474976710654Maximum Value

TimeseriesMetadata

Timeseries Metadata

Metadata about a timeseries query result, describing the series keys present in the data and the fields used for grouping. Used by the client to properly interpret and display the timeseries data.

Details
TypeConditionRequiredDefaultValue LimitsDescription
keysList<string>[]0 ~ 10 itemsList of series keys in the data
groupByList<string>[]0 ~ 10 itemsField(s) used for grouping

TimeseriesPoint

Timeseries Point

A single data point in a timeseries, representing aggregated values at a specific timestamp. Contains one or more values, each corresponding to a different group when grouping is applied.

Details
TypeConditionRequiredDefaultValue LimitsDescription
timestamplong
Timestamp
valuesList<TimeseriesValue>[]0 ~ 10000 itemsValues for each group at this timestamp

TimeseriesValue

Timeseries Value

A single aggregated value within a timeseries data point, keyed by group. When data is grouped (e.g., by service or method), each group has its own value; when ungrouped, the key is “count”.

Details
TypeConditionRequiredDefaultValue LimitsDescription
keystring
~ 256 charsGroup key ("count" if no grouping)
valuedouble
0 ~ 281474976710654Aggregated value

Trace

Trace

A distributed trace that groups related log entries (spans) across microservice calls into a single request flow. Enables end-to-end visibility of how a user’s API request propagates through multiple GS2 microservices.

Details
TypeConditionRequiredDefaultValue LimitsDescription
traceIdstring
UUID~ 36 charsTrace ID
A unique identifier for this trace, shared across all related log entries (spans) in the request flow.
spansList<LogEntry>[]0 ~ 100 itemsSpans
The list of log entries (spans) that make up this trace, representing each processing step in the request flow across microservices.
truncatedboolfalseTruncated
Indicates whether the spans list was truncated due to exceeding the maximum number of entries. When true, some spans in the trace are not included in the response.

InGameLogTag

In-game Log Tag

A key-value pair used to annotate in-game log entries for filtering and categorization. Each tag key must be unique within a single log entry.

Details
TypeConditionRequiredDefaultValue LimitsDescription
keystring
~ 64 charsTag Key
The key name for this tag. Used as the filter criterion when searching in-game logs.
valuestring
~ 128 charsTag Value
The value for this tag. Combined with the key, enables filtering logs by specific criteria (e.g., key=“stageId”, value=“stage-001”).

Methods

describeNamespaces

Get a list of Namespaces

Retrieves a list of namespaces that have been created on a per-service basis within the project. You can use the optional page token to start acquiring data from a specific location in the list. You can also limit the number of namespaces to be acquired.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 1000Number of data items to retrieve

Result

TypeDescription
itemsList<Namespace>List of Namespaces
nextPageTokenstringPage token to retrieve the rest of the listing

Implementation Example

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.NextPageToken
use 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

Create a new Namespace

You must specify detailed information including the name, description, and various settings of the namespace.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
descriptionstring~ 1024 charsDescription
typeString Enum
enum {
  “gs2”,
  “bigquery”,
  “firehose”
}
“gs2”Log Export Method
Determines the destination for exported log data. “gs2” stores logs within GS2’s managed storage with built-in search and analysis capabilities. “bigquery” exports logs to Google BigQuery for advanced analytics. “firehose” streams logs to Amazon Kinesis Data Firehose for delivery to S3, Redshift, or other AWS destinations.
DefinitionDescription
“gs2”Management by GS2
“bigquery”Export to BigQuery
“firehose”Export to Kinesis Firehose
gcpCredentialJsonstring{type} == “bigquery”
✓*
~ 5120 charsGCP Credentials
GCP credential JSON for authenticating when exporting logs to BigQuery. The service account must have BigQuery Data Editor permissions on the target dataset.
* Required if type is “bigquery”
bigQueryDatasetNamestring{type} == “bigquery”
✓*
~ 1024 charsBigQuery Dataset Name
The name of the BigQuery dataset where log data will be exported. The dataset must already exist in the GCP project associated with the provided credentials.
* Required if type is “bigquery”
logExpireDaysint{type} in [“gs2”, “bigquery”]
✓*
0 ~ 3650Log Retention Period (days)
The number of days to retain log data. Logs older than this period are automatically deleted. Applicable when the export method is “gs2” or “bigquery”. Maximum 3650 days (approximately 10 years).
* Required if type is “gs2”,“bigquery”
awsRegionstring{type} == “firehose”
✓*
~ 256 charsAWS Region
The AWS region where the Kinesis Data Firehose delivery stream is located (e.g., us-east-1, ap-northeast-1).
* Required if type is “firehose”
awsAccessKeyIdstring{type} == “firehose”
✓*
~ 256 charsAWS Access Key ID
The AWS access key ID for authenticating with Kinesis Data Firehose. The IAM user must have permissions to put records to the specified Firehose delivery stream.
* Required if type is “firehose”
awsSecretAccessKeystring{type} == “firehose”
✓*
~ 256 charsAWS Secret Access Key
The AWS secret access key paired with the access key ID for Kinesis Data Firehose authentication.
* Required if type is “firehose”
firehoseStreamNamestring{type} == “firehose”
✓*
~ 256 charsKinesis Firehose Stream Name
The name of the Kinesis Data Firehose delivery stream to which log data is sent.
* Required if type is “firehose”
firehoseCompressDataString Enum
enum {
  “none”,
  “gzip”
}
{type} == “firehose”“none”Compress Data for Kinesis Firehose
Whether to compress log data before sending to Kinesis Data Firehose. Gzip compression reduces data transfer volume and storage costs.
DefinitionDescription
“none”Do not compress
“gzip”Gzip
* Required if type is “firehose”

Result

TypeDescription
itemNamespaceNamespace created

Implementation Example

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.Item
use 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

Get Namespace status

Get the current status of the specified namespace. This includes whether the Namespace is active, pending, or in some other state.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
statusstring

Implementation Example

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.Status
use 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

Get Namespace

Get detailed information about the specified namespace. This includes the name, description, and other settings of the namespace.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
itemNamespaceNamespace

Implementation Example

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.Item
use 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

Update Namespace

Update the settings of the specified namespace. You can change the description of the Namespace and specific settings.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
descriptionstring~ 1024 charsDescription
typeString Enum
enum {
  “gs2”,
  “bigquery”,
  “firehose”
}
“gs2”Log Export Method
Determines the destination for exported log data. “gs2” stores logs within GS2’s managed storage with built-in search and analysis capabilities. “bigquery” exports logs to Google BigQuery for advanced analytics. “firehose” streams logs to Amazon Kinesis Data Firehose for delivery to S3, Redshift, or other AWS destinations.
DefinitionDescription
“gs2”Management by GS2
“bigquery”Export to BigQuery
“firehose”Export to Kinesis Firehose
gcpCredentialJsonstring{type} == “bigquery”
✓*
~ 5120 charsGCP Credentials
GCP credential JSON for authenticating when exporting logs to BigQuery. The service account must have BigQuery Data Editor permissions on the target dataset.
* Required if type is “bigquery”
bigQueryDatasetNamestring{type} == “bigquery”
✓*
~ 1024 charsBigQuery Dataset Name
The name of the BigQuery dataset where log data will be exported. The dataset must already exist in the GCP project associated with the provided credentials.
* Required if type is “bigquery”
logExpireDaysint{type} in [“gs2”, “bigquery”]
✓*
0 ~ 3650Log Retention Period (days)
The number of days to retain log data. Logs older than this period are automatically deleted. Applicable when the export method is “gs2” or “bigquery”. Maximum 3650 days (approximately 10 years).
* Required if type is “gs2”,“bigquery”
awsRegionstring{type} == “firehose”
✓*
~ 256 charsAWS Region
The AWS region where the Kinesis Data Firehose delivery stream is located (e.g., us-east-1, ap-northeast-1).
* Required if type is “firehose”
awsAccessKeyIdstring{type} == “firehose”
✓*
~ 256 charsAWS Access Key ID
The AWS access key ID for authenticating with Kinesis Data Firehose. The IAM user must have permissions to put records to the specified Firehose delivery stream.
* Required if type is “firehose”
awsSecretAccessKeystring{type} == “firehose”
✓*
~ 256 charsAWS Secret Access Key
The AWS secret access key paired with the access key ID for Kinesis Data Firehose authentication.
* Required if type is “firehose”
firehoseStreamNamestring{type} == “firehose”
✓*
~ 256 charsKinesis Firehose Stream Name
The name of the Kinesis Data Firehose delivery stream to which log data is sent.
* Required if type is “firehose”
firehoseCompressDataString Enum
enum {
  “none”,
  “gzip”
}
{type} == “firehose”“none”Compress Data for Kinesis Firehose
Whether to compress log data before sending to Kinesis Data Firehose. Gzip compression reduces data transfer volume and storage costs.
DefinitionDescription
“none”Do not compress
“gzip”Gzip
* Required if type is “firehose”

Result

TypeDescription
itemNamespaceUpdated namespace

Implementation Example

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.Item
use 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

Delete Namespace

Delete the specified namespace. This operation is irreversible and all data associated with the deleted Namespace will be lost.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
itemNamespaceDeleted namespace

Implementation Example

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.Item
use 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

Get the microservice version

Details

Request

Request parameters: None

Result

TypeDescription
itemstringVersion

Implementation Example

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.Item
use 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

Get a list of access logs

Queries access logs within the specified time range with optional filtering by service, method, and user ID. Results include the total count and scan size in bytes. When searching periods longer than 7 days, the longTerm flag must be enabled, which may increase API execution fees due to larger scan volumes.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
servicestring~ 1024 charsMicroservice Type
The name of the GS2 microservice that handled the request (e.g., account, inventory, limit).
methodstring~ 1024 charsMicroservice Method
The specific API method that was called on the microservice (e.g., createNamespace, getItem).
userIdstring~ 128 charsUser ID
beginlongThe absolute time 1 hour prior to the current timeSearch range start date and time
endlongNowSearch range end date and time
longTermboolfalseSearch logs for periods longer than 7 days
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 100Number of data items to retrieve
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemsList<AccessLog>List of Access Logs
nextPageTokenstringPage token to retrieve the rest of the listing
totalCountlongTotal number of query results
scanSizelongTotal bytes scanned during search

Implementation Example

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.ScanSize
use 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

Get aggregate results of access logs

Aggregates access log counts within the specified time range, with optional classification by service, method, and/or user ID. Each classification flag controls whether results are grouped by that dimension. When the longTerm flag is enabled, periods longer than 7 days can be searched.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
serviceboolfalseClassify by microservice type
methodboolfalseClassify by microservice method
userIdboolfalseClassify by user ID
beginlongThe absolute time 1 hour prior to the current timeSearch range start date and time
endlongNowSearch range end date and time
longTermboolfalseSearch logs for periods longer than 7 days
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 1000Number of data items to retrieve
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemsList<AccessLogCount>List of Aggregated access log
nextPageTokenstringPage token to retrieve the rest of the listing
totalCountlongTotal number of query results
scanSizelongTotal bytes scanned during search

Implementation Example

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.ScanSize
use 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

Get a list of transaction issue logs

Queries transaction (transaction) issuance logs within the specified time range. Results can be filtered by service, method, user ID, and action type. Includes total count and scan size in the response. Enable the longTerm flag for searches exceeding 7 days.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
servicestring~ 1024 charsMicroservice Type
The name of the GS2 microservice that issued the transaction.
methodstring~ 1024 charsMicroservice Method
The specific API method that triggered the transaction issuance.
userIdstring~ 128 charsUser ID
actionstring~ 1024 charsAcquire Action
The acquire action included in the transaction, specifying what the user will receive upon execution.
beginlongThe absolute time 1 hour prior to the current timeSearch range start date and time
endlongNowSearch range end date and time
longTermboolfalseSearch logs for periods longer than 7 days
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 100Number of data items to retrieve
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemsList<IssueStampSheetLog>List of Transaction issue log
nextPageTokenstringPage token to retrieve the rest of the listing
totalCountlongTotal number of query results
scanSizelongTotal bytes scanned during search

Implementation Example

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.ScanSize
use 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

Get aggregate results of transaction issue logs

Aggregates transaction (transaction) issuance log counts within the specified time range, with optional classification by service, method, user ID, and/or action type. Each classification flag controls whether results are grouped by that dimension.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
serviceboolfalseClassify by microservice type
methodboolfalseClassify by microservice method
userIdboolfalseClassify by user ID
actionboolfalseClassify by acquire actions
beginlongThe absolute time 1 hour prior to the current timeSearch range start date and time
endlongNowSearch range end date and time
longTermboolfalseSearch logs for periods longer than 7 days
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 1000Number of data acquired
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemsList<IssueStampSheetLogCount>List of Aggregated transaction issuance log
nextPageTokenstringPage token to retrieve the rest of the listing
totalCountlongTotal number of query results
scanSizelongTotal bytes scanned during search

Implementation Example

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.ScanSize
use 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

Get a list of transaction execution logs

Queries acquire action execution logs within the specified time range. Results can be filtered by service, method, user ID, and action type. Includes total count and scan size in the response. Enable the longTerm flag for searches exceeding 7 days.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
servicestring~ 1024 charsMicroservice Type
The name of the GS2 microservice that executed the acquire action (e.g., inventory, experience).
methodstring~ 1024 charsMicroservice Method
The specific method invoked on the microservice to execute the acquire action.
userIdstring~ 128 charsUser ID
actionstring~ 1024 charsAcquire Action
The type of acquire action that was executed (e.g., Gs2Inventory:AcquireItemSetByUserId, Gs2Experience:AddExperienceByUserId).
beginlongThe absolute time 1 hour prior to the current timeSearch range start date and time
endlongNowSearch range end date and time
longTermboolfalseSearch logs for periods longer than 7 days
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 100Number of data items to retrieve
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemsList<ExecuteStampSheetLog>List of Acquire Actions execution logs
nextPageTokenstringPage token to retrieve the rest of the listing
totalCountlongTotal number of query results
scanSizelongTotal bytes scanned during search

Implementation Example

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.ScanSize
use 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

Get aggregate results of acquire action execution logs

Aggregates acquire action execution log counts within the specified time range, with optional classification by service, method, user ID, and/or action type. Each classification flag controls whether results are grouped by that dimension.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
serviceboolfalseClassify by microservice type
methodboolfalseClassify by microservice method
userIdboolfalseClassify by user ID
actionboolfalseClassify by acquire actions
beginlongThe absolute time 1 hour prior to the current timeSearch range start date and time
endlongNowSearch range end date and time
longTermboolfalseSearch logs for periods longer than 7 days
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 1000Number of data items to retrieve
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemsList<ExecuteStampSheetLogCount>List of Aggregated acquire actions execution
nextPageTokenstringPage token to retrieve the rest of the listing
totalCountlongTotal number of query results
scanSizelongTotal bytes scanned during search

Implementation Example

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.ScanSize
use 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

Get a list of consume action execution logs

Queries consume action execution logs within the specified time range. Results can be filtered by service, method, user ID, and action type. Includes total count and scan size in the response. Enable the longTerm flag for searches exceeding 7 days.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
servicestring~ 1024 charsMicroservice Type
The name of the GS2 microservice that executed the consume action (e.g., inventory, money).
methodstring~ 1024 charsMicroservice Method
The specific method invoked on the microservice to execute the consume action.
userIdstring~ 128 charsUser ID
actionstring~ 1024 charsConsume Action
The type of consume action that was executed (e.g., Gs2Inventory:ConsumeItemSetByUserId, Gs2Money:WithdrawByUserId).
beginlongThe absolute time 1 hour prior to the current timeSearch range start date and time
endlongNowSearch range end date and time
longTermboolfalseSearch logs for periods longer than 7 days
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 100Number of data items to retrieve
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemsList<ExecuteStampTaskLog>List of consume action execution log
nextPageTokenstringPage token to retrieve the rest of the listing
totalCountlongTotal number of query results
scanSizelongTotal bytes scanned during search

Implementation Example

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.ScanSize
use 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

Get aggregate results of consume action execution logs

Aggregates consume action execution log counts within the specified time range, with optional classification by service, method, user ID, and/or action type. Each classification flag controls whether results are grouped by that dimension.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
serviceboolfalseClassify by microservice type
methodboolfalseClassify by microservice method
userIdboolfalseClassify by user ID
actionboolfalseClassify by acquire actions
beginlongThe absolute time 1 hour prior to the current timeSearch range start date and time
endlongNowSearch range end date and time
longTermboolfalseSearch logs for periods longer than 7 days
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 1000Number of data items to retrieve
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemsList<ExecuteStampTaskLogCount>List of Aggregated consume action execution log
nextPageTokenstringPage token to retrieve the rest of the listing
totalCountlongTotal number of query results
scanSizelongTotal bytes scanned during search

Implementation Example

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.ScanSize
use 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

Get a list of in-game logs

Queries custom in-game logs within the specified time range with optional filtering by user ID and tags. In-game logs are developer-defined log entries that can contain arbitrary payload data and tags for classification. Enable the longTerm flag for searches exceeding 7 days.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userIdstring~ 128 charsUser ID
tagsList<InGameLogTag>[]0 ~ 20 itemsTags
Key-value pairs attached to the log entry for filtering and categorization. Tags enable efficient searching and aggregation of in-game logs (e.g., event type, stage ID, item category).
beginlongThe absolute time 1 hour prior to the current timeSearch range start date and time
endlongThe absolute time 1 hour after the current timeSearch range end date and time
longTermboolfalseSearch logs for periods longer than 7 days
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 100Number of data items to retrieve
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemsList<InGameLog>List of in-game logs
nextPageTokenstringPage token to retrieve the rest of the listing
totalCountlongTotal number of query results
scanSizelongTotal bytes scanned during search

Implementation Example

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.ScanSize
use 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

Send in-game log

Sends a custom in-game log entry for the requesting user with the specified tags and payload. Tags are used for classification and filtering when querying logs. The payload can contain arbitrary data defined by the developer.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
accessTokenstring~ 128 charsAccess token
tagsList<InGameLogTag>[]0 ~ 20 itemsTags
Key-value pairs attached to the log entry for filtering and categorization. Tags enable efficient searching and aggregation of in-game logs (e.g., event type, stage ID, item category).
payloadstring
~ 10485760 charsPayload
The custom log data in JSON format. Can contain any game-specific information such as player actions, game state, or business metrics. Maximum 10MB.

Result

TypeDescription
itemInGameLogIn-game log

Implementation Example

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.Item
use 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

Send in-game log by specifying a user ID

Sends a custom in-game log entry for the specified user with the specified tags and payload.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userIdstring~ 128 charsUser ID
tagsList<InGameLogTag>[]0 ~ 20 itemsTags
Key-value pairs attached to the log entry for filtering and categorization. Tags enable efficient searching and aggregation of in-game logs (e.g., event type, stage ID, item category).
payloadstring
~ 10485760 charsPayload
The custom log data in JSON format. Can contain any game-specific information such as player actions, game state, or business metrics. Maximum 10MB.
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemInGameLogIn-game log

Implementation Example

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.Item
use 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

Get a list of access logs with telemetry

Queries access logs that include telemetry data within the specified time range, with optional filtering by user ID. Telemetry data provides additional performance and diagnostic information for each API call. When searching periods longer than 7 days, the longTerm flag must be enabled.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userIdstring~ 128 charsUser ID
beginlongThe absolute time 1 hour prior to the current timeSearch range start date and time
endlongNowSearch range end date and time
longTermboolfalseSearch logs for periods longer than 7 days
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 1000Number of data items to retrieve
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemsList<AccessLogWithTelemetry>List of Access Logs
nextPageTokenstringPage token to retrieve the rest of the listing
totalCountlongTotal number of query results
scanSizelongTotal bytes scanned during search

Implementation Example

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.ScanSize
use 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

Get a list of insights

Retrieves a paginated list of GS2-Insight instances for the specified namespace. Each insight represents a log analysis environment that can be started and automatically shuts down after 2 hours.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 1000Number of data items to retrieve

Result

TypeDescription
itemsList<Insight>List of GS2-Insights
nextPageTokenstringPage token to retrieve the rest of the listing

Implementation Example

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.NextPageToken
use 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

Create insight

Starts a new GS2-Insight log analysis environment for the specified namespace. The insight instance will automatically shut down after 2 hours of uptime. Only one instance can be active per namespace at a time.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
itemInsightGS2-Insight

Implementation Example

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.Item
use 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

Get GS2-Insight

Retrieves the specified GS2-Insight instance, including its current status and startup time.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
insightNamestring
UUID~ 36 charsName

Result

TypeDescription
itemInsightGS2-Insight

Implementation Example

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.Item
use 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

Delete a insight

Deletes the specified GS2-Insight instance, shutting down the log analysis environment immediately.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
insightNamestring
UUID~ 36 charsName

Result

TypeDescription
itemInsightGS2-Insight

Implementation Example

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.Item
use 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

Get list of dashboards

Retrieves a paginated list of dashboards for the specified namespace. Dashboards provide customizable views for visualizing log data and metrics. Can optionally filter by name prefix.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
namePrefixstring~ 64 charsFilter by namespace name prefix
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 1000Number of data items to retrieve

Result

TypeDescription
itemsList<Dashboard>List of Dashboards
nextPageTokenstringPage token to retrieve the rest of the listing

Implementation Example

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.NextPageToken
use 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

Create new dashboard

Creates a new dashboard with the specified display name and description. The dashboard payload (layout and widget configuration) can be set later via update.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
displayNamestring
~ 256 charsDisplay Name
A human-readable name for this dashboard, shown in the dashboard list and header.
descriptionstring~ 1024 charsDescription

Result

TypeDescription
itemDashboardCreated Dashboard

Implementation Example

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.Item
use 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

Get Dashboard

Retrieves the specified dashboard, including its display name, description, and payload configuration.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
dashboardNamestring
UUID~ 36 charsDashboard Name

Result

TypeDescription
itemDashboardDashboard

Implementation Example

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.Item
use 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

Update Dashboard

Updates the specified dashboard’s display name, description, and/or payload configuration. The payload contains the dashboard layout and widget definitions.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
dashboardNamestring
UUID~ 36 charsDashboard Name
displayNamestring
~ 256 charsDisplay Name
A human-readable name for this dashboard, shown in the dashboard list and header.
descriptionstring~ 1024 charsDescription
payloadstring
~ 1048576 charsPayload
The dashboard configuration in JSON format, containing widget definitions, layout information, query settings, and visualization options.

Result

TypeDescription
itemDashboardUpdated Dashboard

Implementation Example

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.Item
use 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

Duplicate Dashboard

Creates a copy of the specified dashboard with all its configuration, including the payload (layout and widget definitions).

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
dashboardNamestring
UUID~ 36 charsDashboard Name

Result

TypeDescription
itemDashboardCreated Dashboard

Implementation Example

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.Item
use 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

Delete Dashboard

Deletes the specified dashboard and all its configuration permanently.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
dashboardNamestring
UUID~ 36 charsDashboard Name

Result

TypeDescription
itemDashboardDeleted Dashboard

Implementation Example

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.Item
use 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

Get list of facet models

Retrieves a paginated list of facet models for the specified namespace. Facet models define custom classification fields for log queries, specifying the field name, type (string or measure), display name, and sort order.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
namePrefixstring~ 64 charsFilter by namespace name prefix
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 1000Number of data items to retrieve

Result

TypeDescription
itemsList<FacetModel>List of Facet Models
nextPageTokenstringPage token to retrieve the rest of the listing

Implementation Example

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.NextPageToken
use 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

Create new facet model

Creates a new facet model with the specified field name, type, display name, and sort order. The field type can be ‘string’ for categorical classification or ‘measure’ for numeric aggregation in log queries.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
fieldstring
~ 128 charsFacet Field Name
The name of the log field that this facet operates on (e.g., “service”, “method”, “status”).
typeString Enum
enum {
  “string”,
  “double”,
  “measure”
}
Facet Data Type
The data type of the facet field. “string” for categorical values with value counts, “double” for numeric values with range filtering, “measure” for measurement values with statistical analysis.
DefinitionDescription
“string”String
“double”Double
“measure”Measure
displayNamestring
~ 128 charsDisplay Name
A human-readable name for this facet, shown in the log search UI.
orderint00 ~ 100000Display Order
The sort order for displaying this facet in the UI. Lower values appear first.

Result

TypeDescription
itemFacetModelCreated Facet Model

Implementation Example

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.Item
use 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

Get Facet Model

Retrieves the specified facet model, including its field name, type, display name, and sort order.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
fieldstring
~ 128 charsFacet Field Name
The name of the log field that this facet operates on (e.g., “service”, “method”, “status”).

Result

TypeDescription
itemFacetModelFacet Model

Implementation Example

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.Item
use 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

Update Facet Model

Updates the specified facet model’s type, display name, and/or sort order.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
fieldstring
~ 128 charsFacet Field Name
The name of the log field that this facet operates on (e.g., “service”, “method”, “status”).
typeString Enum
enum {
  “string”,
  “double”,
  “measure”
}
Facet Data Type
The data type of the facet field. “string” for categorical values with value counts, “double” for numeric values with range filtering, “measure” for measurement values with statistical analysis.
DefinitionDescription
“string”String
“double”Double
“measure”Measure
displayNamestring
~ 128 charsDisplay Name
A human-readable name for this facet, shown in the log search UI.
orderint00 ~ 100000Display Order
The sort order for displaying this facet in the UI. Lower values appear first.

Result

TypeDescription
itemFacetModelUpdated Facet Model

Implementation Example

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.Item
use 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

Delete Facet Model

Deletes the specified facet model. Deleted facet models will no longer be available for classification in log queries.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
fieldstring
~ 128 charsFacet Field Name
The name of the log field that this facet operates on (e.g., “service”, “method”, “status”).

Result

TypeDescription
itemFacetModelDeleted Facet Model

Implementation Example

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.Item
use 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

Time Series Query (Metrics)

Queries time series data from metrics with configurable aggregation, grouping, and interval. Supports multiple aggregation configurations, groupBy labels for multi-dimensional analysis, and sorting by value or name in ascending/descending order. The maximum number of data points is 1500; requests exceeding this limit will be rejected.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
beginlongThe absolute time 1 hour prior to the current timeSearch range start date and time
endlongNowSearch range end date and time
querystring~ 10240 charsSearch query string
groupByList<string>[]0 ~ 10 itemsFields to group by
aggregationsList<AggregationConfig>[]0 ~ 10 itemsList of aggregation configurations
intervalint600001000 ~ 86400000Aggregation interval in milliseconds
seriesLimitint101 ~ 1000Number of series to retrieve
orderKeyString Enum
enum {
  “value”,
  “name”
}
“value”Order key
DefinitionDescription
“value”Value
“name”Name
orderByString Enum
enum {
  “asc”,
  “desc”
}
“desc”Order by
DefinitionDescription
“asc”Ascending
“desc”Descending

Result

TypeDescription
itemsList<TimeseriesPoint>List of Time Series Values
timeseriesMetadataTimeseriesMetadataMetadata of Time Series

Implementation Example

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.TimeseriesMetadata
use 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

Get list of metrics

Retrieves a paginated list of available metric models for the specified namespace. Metric models define the built-in metrics that can be queried via the time series API. Can optionally filter by name prefix.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
namePrefixstring~ 64 charsFilter by namespace name prefix
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 1000Number of data items to retrieve

Result

TypeDescription
itemsList<MetricModel>List of Metric Models
nextPageTokenstringPage token to retrieve the rest of the listing

Implementation Example

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.NextPageToken
use 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

Get list of label values for a specific metric

Retrieves the available label values for a specific metric. Label values can be used as groupBy fields or filters in time series queries. Can optionally filter by label name prefix.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
metricNamestring
~ 128 charsMetric name to filter by
labelNamePrefixstring~ 64 charsFilter by label name prefix
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 1000Number of data items to retrieve

Result

TypeDescription
itemsList<Label>List of Label Values
nextPageTokenstringPage token to retrieve the rest of the listing

Implementation Example

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: nil,
        LabelNamePrefix: nil,
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use 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(null)
            ->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(null)
            .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(null)
        .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(null)
            .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(None)
            .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=nil,
    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=nil,
    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

Query log entries (v2)

Queries log entries using the v2 log query API with optional full-text search. Supports query string filtering and returns a total entry count (capped at 10001 if exceeding 10000).

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
beginlongThe absolute time 1 hour prior to the current timeSearch range start date and time
endlongNowSearch range end date and time
querystring~ 10240 charsSearch query string
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 1000Number of data items to retrieve

Result

TypeDescription
itemsList<LogEntry>List of Access Logs
totalEntryCountintTotal number of query results (returns 10001 if it exceeds 10000)
nextPageTokenstringPage token to retrieve the rest of the listing

Implementation Example

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.NextPageToken
use 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

Get a single log entry by request ID

Retrieves a specific log entry by its request ID within the specified time range. The request ID uniquely identifies a single API call log entry.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
logRequestIdstring
~ 128 charsRequest ID
beginlongThe absolute time 1 hour prior to the current timeSearch range start date and time
endlongNowSearch range end date and time

Result

TypeDescription
itemLogEntryAccess Log

Implementation Example

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.Item
use 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

Facet Query

Retrieves facet (classification) data for log entries within the specified time range. Returns both built-in facets (service, function, status, duration) and custom facet models defined for the namespace. Supports query string filtering to narrow down the facet scope.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
beginlongThe absolute time 1 hour prior to the current timeSearch range start date and time
endlongNowSearch range end date and time
querystring~ 10240 charsSearch query string

Result

TypeDescription
itemsList<Facet>List of Facets

Implementation Example

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.Items
use 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

Time Series Query (Log)

Queries time series data from log entries with configurable aggregation, grouping, and interval. Supports groupBy fields for multi-dimensional analysis and a single aggregation configuration. The maximum number of data points is 1500; requests exceeding this limit will be rejected. Results can be paginated and the number of series can be limited.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
beginlongThe absolute time 1 hour prior to the current timeSearch range start date and time
endlongNowSearch range end date and time
querystring~ 10240 charsSearch query string
groupByList<string>[]0 ~ 10 itemsFields to group by
aggregationAggregationConfig
Aggregation configuration
intervalint600001000 ~ 86400000Aggregation interval in milliseconds
seriesLimitint101 ~ 1000Number of series to retrieve
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 1000Number of data items to retrieve

Result

TypeDescription
itemsList<TimeseriesPoint>List of Time Series Values
timeseriesMetadataTimeseriesMetadataMetadata of Time Series
nextPageTokenstringPage token to retrieve the rest of the listing

Implementation Example

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.NextPageToken
use 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

Get trace by trace ID

Retrieves a trace and its associated log entries by trace ID within the specified time range. Returns the main trace along with any parallel traces that were executed concurrently, with a flag indicating if the parallel list was truncated.

Details

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
traceIdstring
UUID~ 36 charsTrace ID
A unique identifier for this trace, shared across all related log entries (spans) in the request flow.
beginlongThe absolute time 1 hour prior to the current timeSearch range start date and time
endlongNowSearch range end date and time

Result

TypeDescription
traceTraceTrace
parallelsList<Trace>List of traces that were run in parallel
parallelTruncatedboolIndicates if the parallels list was truncated

Implementation Example

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.ParallelTruncated
use 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;