API Reference of GS2-Log SDK
Model
Namespace
Namespace
Namespace is a mechanism that allows multiple uses of the same service for different purposes within a single project. Each GS2 service is managed per namespace. Services within different namespaces are treated as completely independent data spaces, even if they are the same service.
Therefore, it is necessary to create a namespace before starting to use each service.
| Type | Condition | Required | Default | Value Limits | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| namespaceId | string | ✓ | ~ 1024 chars | Namespace GRN | ||||||||||
| name | string | ✓ | ~ 128 chars | Namespace name | ||||||||||
| description | string | ~ 1024 chars | Description | |||||||||||
| type | String Enum enum { “gs2”, “bigquery”, “firehose” } | ✓ | “gs2” | ~ 128 chars | Log Export Method
| |||||||||
| gcpCredentialJson | string | {type} == “bigquery” | ✓ | ~ 5120 chars | GCP Credentials If type is “bigquery”, then required | |||||||||
| bigQueryDatasetName | string | {type} == “bigquery” | ✓ | ~ 1024 chars | BigQuery dataset name If type is “bigquery”, then required | |||||||||
| logExpireDays | int | {type} in [“gs2”, “bigquery”] | ✓ | 0 ~ 3650 | Log retention period (days) If type is “gs2”,“bigquery”, then required | |||||||||
| awsRegion | string | {type} == “firehose” | ✓ | ~ 256 chars | AWS Region If type is “firehose”, then required | |||||||||
| awsAccessKeyId | string | {type} == “firehose” | ✓ | ~ 256 chars | AWS access key ID If type is “firehose”, then required | |||||||||
| awsSecretAccessKey | string | {type} == “firehose” | ✓ | ~ 256 chars | AWS Secret Access Key If type is “firehose”, then required | |||||||||
| firehoseStreamName | string | {type} == “firehose” | ✓ | ~ 256 chars | Kinesis Firehose stream name If type is “firehose”, then required | |||||||||
| firehoseCompressData | String Enum enum { “none”, “gzip” } | {type} == “firehose” | ✓ | “none” | ~ 128 chars | Compress data to output to Kinesis Firehose
If type is “firehose”, then required | ||||||||
| status | string | “ACTIVE” | ~ 128 chars | status | ||||||||||
| createdAt | long | ✓ | Now | Datetime of creation (Unix time, milliseconds) | ||||||||||
| updatedAt | long | ✓ | Now | Datetime of last update (Unix time, milliseconds) | ||||||||||
| revision | long | 0 | 0 ~ 9223372036854775805 | Revision |
AccessLog
Access log
This log records requests to microservices and their responses.
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| timestamp | long | ✓ | Timestamp (Unix time, milliseconds) | |||
| requestId | string | ✓ | ~ 1024 chars | Request ID | ||
| service | string | ✓ | ~ 1024 chars | Types of Microservices | ||
| method | string | ✓ | ~ 1024 chars | Microservice Methods | ||
| userId | string | ~ 128 chars | User Id | |||
| request | string | ✓ | ~ 10485760 chars | Request Content | ||
| result | string | ✓ | ~ 10485760 chars | Response Content |
AccessLogCount
Access log aggregation
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| service | string | ~ 1024 chars | Types of Microservices | |||
| method | string | ~ 1024 chars | Microservice Methods | |||
| userId | string | ~ 128 chars | User Id | |||
| count | long | ✓ | 0 ~ 9223372036854775805 | Count |
IssueStampSheetLog
Issued transaction log
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| timestamp | long | ✓ | Timestamp (Unix time, milliseconds) | |||
| transactionId | string | ✓ | ~ 1024 chars | Transaction ID | ||
| service | string | ✓ | ~ 1024 chars | Types of Microservices | ||
| method | string | ✓ | ~ 1024 chars | Microservice Methods | ||
| userId | string | ✓ | ~ 128 chars | User Id | ||
| action | string | ✓ | ~ 1024 chars | Acquire Action | ||
| args | string | ✓ | ~ 5242880 chars | Arguments | ||
| tasks | List<string> | 0 ~ 10 items | List of Stamp task |
IssueStampSheetLogCount
Issued transaction log
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| service | string | ~ 1024 chars | Types of Microservices | |||
| method | string | ~ 1024 chars | Microservice Methods | |||
| userId | string | ~ 128 chars | User Id | |||
| action | string | ~ 1024 chars | Acquire Action | |||
| count | long | ✓ | 0 ~ 9223372036854775805 | Count |
ExecuteStampSheetLog
Stamp Sheet Execution Log
This is a log of the execution details of the transaction for each microservice.
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| timestamp | long | ✓ | Timestamp (Unix time, milliseconds) | |||
| transactionId | string | ✓ | ~ 1024 chars | Transaction ID | ||
| service | string | ✓ | ~ 1024 chars | Types of Microservices | ||
| method | string | ✓ | ~ 1024 chars | Microservice Methods | ||
| userId | string | ✓ | ~ 128 chars | User Id | ||
| action | string | ✓ | ~ 1024 chars | Acquire Action | ||
| args | string | ✓ | ~ 5242880 chars | Arguments |
ExecuteStampSheetLogCount
Acquire actions execution log tally
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| service | string | ~ 1024 chars | Types of Microservices | |||
| method | string | ~ 1024 chars | Microservice Methods | |||
| userId | string | ~ 128 chars | User Id | |||
| action | string | ~ 1024 chars | Acquire Action | |||
| count | long | ✓ | 0 ~ 9223372036854775805 | Count |
ExecuteStampTaskLog
Stamp Task Execution Log
This is a log of the execution details of the stamp task for each microservice.
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| timestamp | long | ✓ | Timestamp (Unix time, milliseconds) | |||
| taskId | string | ✓ | ~ 1024 chars | Task ID | ||
| service | string | ✓ | ~ 1024 chars | Types of Microservices | ||
| method | string | ✓ | ~ 1024 chars | Microservice Methods | ||
| userId | string | ✓ | ~ 128 chars | User Id | ||
| action | string | ✓ | ~ 1024 chars | Acquire Action | ||
| args | string | ✓ | ~ 5242880 chars | Arguments |
ExecuteStampTaskLogCount
Acquire actions execution log tally
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| service | string | ~ 1024 chars | Types of Microservices | |||
| method | string | ~ 1024 chars | Microservice Methods | |||
| userId | string | ~ 128 chars | User Id | |||
| action | string | ~ 1024 chars | Acquire Action | |||
| count | long | ✓ | 0 ~ 9223372036854775805 | Count |
InGameLog
In-game log
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| timestamp | long | ✓ | Timestamp (Unix time, milliseconds) | |||
| requestId | string | ✓ | ~ 1024 chars | Request ID | ||
| userId | string | ~ 128 chars | User Id | |||
| tags | List<InGameLogTag> | 0 ~ 20 items | Tags | |||
| payload | string | ✓ | ~ 10485760 chars | Payload in JSON format |
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.
| Type | Condition | Required | Default | Value Limits | Description | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| timestamp | long | ✓ | Timestamp (Unix time, milliseconds) | |||||||||
| sourceRequestId | string | ✓ | ~ 1024 chars | Source Request ID | ||||||||
| requestId | string | ✓ | ~ 1024 chars | Request ID | ||||||||
| duration | long | ✓ | 0 ~ 9223372036854775805 | Duration(ms) | ||||||||
| service | string | ✓ | ~ 1024 chars | Types of Microservices | ||||||||
| method | string | ✓ | ~ 1024 chars | Microservice Methods | ||||||||
| userId | string | ~ 128 chars | User Id | |||||||||
| request | string | ✓ | ~ 10485760 chars | Request Content | ||||||||
| result | string | ✓ | ~ 10485760 chars | Response Content | ||||||||
| status | String Enum enum { “ok”, “error” } | ✓ | ~ 128 chars | Duration(ms)
|
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.
| Type | Condition | Required | Default | Value Limits | Description | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| insightId | string | ✓ | ~ 1024 chars | GS2-Insight GRN | ||||||||||||
| name | string | ✓ | UUID | ~ 36 chars | Name | |||||||||||
| taskId | string | ~ 128 chars | Task ID | |||||||||||||
| host | string | ~ 256 chars | Host Name | |||||||||||||
| password | string | ✓ | ~ 32 chars | Password | ||||||||||||
| status | String Enum enum { “ALLOCATING”, “LAUNCHING”, “ACTIVE”, “DELETED” } | ✓ | “ALLOCATING” | ~ 128 chars | Status
| |||||||||||
| createdAt | long | ✓ | Now | Datetime of creation (Unix time, milliseconds) | ||||||||||||
| revision | long | 0 | 0 ~ 9223372036854775805 | Revision |
InGameLogTag
In-game log tag
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| key | string | ✓ | ~ 64 chars | Tag Key | ||
| value | string | ✓ | ~ 128 chars | Tag Value |
Methods
describeNamespaces
Get list of namespaces
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | |||
| limit | int | ✓ | 30 | 1 ~ 1000 | Number of data acquired |
Result
| Type | Description | |
|---|---|---|
| items | List<Namespace> | List of Namespace |
| nextPageToken | string | Page 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.NextPageTokenuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\DescribeNamespacesRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->describeNamespaces(
(new DescribeNamespacesRequest())
->withPageToken(null)
->withLimit(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.DescribeNamespacesRequest;
import io.gs2.log.result.DescribeNamespacesResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
DescribeNamespacesResult result = client.describeNamespaces(
new DescribeNamespacesRequest()
.withPageToken(null)
.withLimit(null)
);
List<Namespace> items = result.getItems();
String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.DescribeNamespacesResult> asyncResult = null;
yield return client.DescribeNamespaces(
new Gs2.Gs2Log.Request.DescribeNamespacesRequest()
.WithPageToken(null)
.WithLimit(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.describeNamespaces(
new Gs2Log.DescribeNamespacesRequest()
.withPageToken(null)
.withLimit(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.describe_namespaces(
log.DescribeNamespacesRequest()
.with_page_token(None)
.with_limit(None)
)
items = result.items
next_page_token = result.next_page_token
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.describe_namespaces({
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
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['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;createNamespace
Create a new namespace
Request
| Type | Condition | Required | Default | Value Limits | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| name | string | ✓ | ~ 128 chars | Namespace name | ||||||||||
| description | string | ~ 1024 chars | Description | |||||||||||
| type | String Enum enum { “gs2”, “bigquery”, “firehose” } | ✓ | “gs2” | ~ 128 chars | Log Export Method
| |||||||||
| gcpCredentialJson | string | {type} == “bigquery” | ✓ | ~ 5120 chars | GCP Credentials If type is “bigquery”, then required | |||||||||
| bigQueryDatasetName | string | {type} == “bigquery” | ✓ | ~ 1024 chars | BigQuery dataset name If type is “bigquery”, then required | |||||||||
| logExpireDays | int | {type} in [“gs2”, “bigquery”] | ✓ | 0 ~ 3650 | Log retention period (days) If type is “gs2”,“bigquery”, then required | |||||||||
| awsRegion | string | {type} == “firehose” | ✓ | ~ 256 chars | AWS Region If type is “firehose”, then required | |||||||||
| awsAccessKeyId | string | {type} == “firehose” | ✓ | ~ 256 chars | AWS access key ID If type is “firehose”, then required | |||||||||
| awsSecretAccessKey | string | {type} == “firehose” | ✓ | ~ 256 chars | AWS Secret Access Key If type is “firehose”, then required | |||||||||
| firehoseStreamName | string | {type} == “firehose” | ✓ | ~ 256 chars | Kinesis Firehose stream name If type is “firehose”, then required | |||||||||
| firehoseCompressData | String Enum enum { “none”, “gzip” } | {type} == “firehose” | ✓ | “none” | ~ 128 chars | Compress data to output to Kinesis Firehose
If type is “firehose”, then required |
Result
| Type | Description | |
|---|---|---|
| item | Namespace | Namespace 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.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\CreateNamespaceRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->createNamespace(
(new CreateNamespaceRequest())
->withName("namespace-0001")
->withDescription(null)
->withType("gs2")
->withGcpCredentialJson("{\"project_id\": \"gs2-dev\"}")
->withBigQueryDatasetName("dataset_0001")
->withLogExpireDays(3)
->withAwsRegion("awsRegion")
->withAwsAccessKeyId("awsAccessKeyId")
->withAwsSecretAccessKey("awsSecretAccessKey")
->withFirehoseStreamName("firehoseStreamName")
->withFirehoseCompressData(null)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.CreateNamespaceRequest;
import io.gs2.log.result.CreateNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
CreateNamespaceResult result = client.createNamespace(
new CreateNamespaceRequest()
.withName("namespace-0001")
.withDescription(null)
.withType("gs2")
.withGcpCredentialJson("{\"project_id\": \"gs2-dev\"}")
.withBigQueryDatasetName("dataset_0001")
.withLogExpireDays(3)
.withAwsRegion("awsRegion")
.withAwsAccessKeyId("awsAccessKeyId")
.withAwsSecretAccessKey("awsSecretAccessKey")
.withFirehoseStreamName("firehoseStreamName")
.withFirehoseCompressData(null)
);
Namespace item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.CreateNamespaceResult> asyncResult = null;
yield return client.CreateNamespace(
new Gs2.Gs2Log.Request.CreateNamespaceRequest()
.WithName("namespace-0001")
.WithDescription(null)
.WithType("gs2")
.WithGcpCredentialJson("{\"project_id\": \"gs2-dev\"}")
.WithBigQueryDatasetName("dataset_0001")
.WithLogExpireDays(3)
.WithAwsRegion("awsRegion")
.WithAwsAccessKeyId("awsAccessKeyId")
.WithAwsSecretAccessKey("awsSecretAccessKey")
.WithFirehoseStreamName("firehoseStreamName")
.WithFirehoseCompressData(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.createNamespace(
new Gs2Log.CreateNamespaceRequest()
.withName("namespace-0001")
.withDescription(null)
.withType("gs2")
.withGcpCredentialJson("{\"project_id\": \"gs2-dev\"}")
.withBigQueryDatasetName("dataset_0001")
.withLogExpireDays(3)
.withAwsRegion("awsRegion")
.withAwsAccessKeyId("awsAccessKeyId")
.withAwsSecretAccessKey("awsSecretAccessKey")
.withFirehoseStreamName("firehoseStreamName")
.withFirehoseCompressData(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.create_namespace(
log.CreateNamespaceRequest()
.with_name('namespace-0001')
.with_description(None)
.with_type('gs2')
.with_gcp_credential_json('{"project_id": "gs2-dev"}')
.with_big_query_dataset_name('dataset_0001')
.with_log_expire_days(3)
.with_aws_region('awsRegion')
.with_aws_access_key_id('awsAccessKeyId')
.with_aws_secret_access_key('awsSecretAccessKey')
.with_firehose_stream_name('firehoseStreamName')
.with_firehose_compress_data(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.create_namespace({
name="namespace-0001",
description=nil,
type="gs2",
gcpCredentialJson="{\"project_id\": \"gs2-dev\"}",
bigQueryDatasetName="dataset_0001",
logExpireDays=3,
awsRegion="awsRegion",
awsAccessKeyId="awsAccessKeyId",
awsSecretAccessKey="awsSecretAccessKey",
firehoseStreamName="firehoseStreamName",
firehoseCompressData=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
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['message'])
end
result = api_result.result
item = result.item;getNamespaceStatus
Get namespace status
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name |
Result
| Type | Description | |
|---|---|---|
| status | string |
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.Statususe Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\GetNamespaceStatusRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->getNamespaceStatus(
(new GetNamespaceStatusRequest())
->withNamespaceName("namespace-0001")
);
$status = $result->getStatus();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.GetNamespaceStatusRequest;
import io.gs2.log.result.GetNamespaceStatusResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
GetNamespaceStatusResult result = client.getNamespaceStatus(
new GetNamespaceStatusRequest()
.withNamespaceName("namespace-0001")
);
String status = result.getStatus();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.GetNamespaceStatusResult> asyncResult = null;
yield return client.GetNamespaceStatus(
new Gs2.Gs2Log.Request.GetNamespaceStatusRequest()
.WithNamespaceName("namespace-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var status = result.Status;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.getNamespaceStatus(
new Gs2Log.GetNamespaceStatusRequest()
.withNamespaceName("namespace-0001")
);
const status = result.getStatus();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.get_namespace_status(
log.GetNamespaceStatusRequest()
.with_namespace_name('namespace-0001')
)
status = result.status
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.get_namespace_status({
namespaceName="namespace-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
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['message'])
end
result = api_result.result
status = result.status;getNamespace
Get namespace
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name |
Result
| Type | Description | |
|---|---|---|
| item | Namespace | 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.GetNamespace(
&log.GetNamespaceRequest {
NamespaceName: pointy.String("namespace-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\GetNamespaceRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->getNamespace(
(new GetNamespaceRequest())
->withNamespaceName("namespace-0001")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.GetNamespaceRequest;
import io.gs2.log.result.GetNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
GetNamespaceResult result = client.getNamespace(
new GetNamespaceRequest()
.withNamespaceName("namespace-0001")
);
Namespace item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.GetNamespaceResult> asyncResult = null;
yield return client.GetNamespace(
new Gs2.Gs2Log.Request.GetNamespaceRequest()
.WithNamespaceName("namespace-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.getNamespace(
new Gs2Log.GetNamespaceRequest()
.withNamespaceName("namespace-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.get_namespace(
log.GetNamespaceRequest()
.with_namespace_name('namespace-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.get_namespace({
namespaceName="namespace-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
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['message'])
end
result = api_result.result
item = result.item;updateNamespace
Update namespace
Request
| Type | Condition | Required | Default | Value Limits | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||||||||||
| description | string | ~ 1024 chars | Description | |||||||||||
| type | String Enum enum { “gs2”, “bigquery”, “firehose” } | ✓ | “gs2” | ~ 128 chars | Log Export Method
| |||||||||
| gcpCredentialJson | string | {type} == “bigquery” | ✓ | ~ 5120 chars | GCP Credentials If type is “bigquery”, then required | |||||||||
| bigQueryDatasetName | string | {type} == “bigquery” | ✓ | ~ 1024 chars | BigQuery dataset name If type is “bigquery”, then required | |||||||||
| logExpireDays | int | {type} in [“gs2”, “bigquery”] | ✓ | 0 ~ 3650 | Log retention period (days) If type is “gs2”,“bigquery”, then required | |||||||||
| awsRegion | string | {type} == “firehose” | ✓ | ~ 256 chars | AWS Region If type is “firehose”, then required | |||||||||
| awsAccessKeyId | string | {type} == “firehose” | ✓ | ~ 256 chars | AWS access key ID If type is “firehose”, then required | |||||||||
| awsSecretAccessKey | string | {type} == “firehose” | ✓ | ~ 256 chars | AWS Secret Access Key If type is “firehose”, then required | |||||||||
| firehoseStreamName | string | {type} == “firehose” | ✓ | ~ 256 chars | Kinesis Firehose stream name If type is “firehose”, then required | |||||||||
| firehoseCompressData | String Enum enum { “none”, “gzip” } | {type} == “firehose” | ✓ | “none” | ~ 128 chars | Compress data to output to Kinesis Firehose
If type is “firehose”, then required |
Result
| Type | Description | |
|---|---|---|
| item | Namespace | Updated 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.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\UpdateNamespaceRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->updateNamespace(
(new UpdateNamespaceRequest())
->withNamespaceName("namespace-0001")
->withDescription("description1")
->withType("firehose")
->withGcpCredentialJson("{\"project_id\": \"gs2-dev\"}")
->withBigQueryDatasetName("dataset_0001")
->withLogExpireDays(3)
->withAwsRegion("awsRegion")
->withAwsAccessKeyId("awsAccessKeyId")
->withAwsSecretAccessKey("awsSecretAccessKey")
->withFirehoseStreamName("firehoseStreamName")
->withFirehoseCompressData(null)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.UpdateNamespaceRequest;
import io.gs2.log.result.UpdateNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
UpdateNamespaceResult result = client.updateNamespace(
new UpdateNamespaceRequest()
.withNamespaceName("namespace-0001")
.withDescription("description1")
.withType("firehose")
.withGcpCredentialJson("{\"project_id\": \"gs2-dev\"}")
.withBigQueryDatasetName("dataset_0001")
.withLogExpireDays(3)
.withAwsRegion("awsRegion")
.withAwsAccessKeyId("awsAccessKeyId")
.withAwsSecretAccessKey("awsSecretAccessKey")
.withFirehoseStreamName("firehoseStreamName")
.withFirehoseCompressData(null)
);
Namespace item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.UpdateNamespaceResult> asyncResult = null;
yield return client.UpdateNamespace(
new Gs2.Gs2Log.Request.UpdateNamespaceRequest()
.WithNamespaceName("namespace-0001")
.WithDescription("description1")
.WithType("firehose")
.WithGcpCredentialJson("{\"project_id\": \"gs2-dev\"}")
.WithBigQueryDatasetName("dataset_0001")
.WithLogExpireDays(3)
.WithAwsRegion("awsRegion")
.WithAwsAccessKeyId("awsAccessKeyId")
.WithAwsSecretAccessKey("awsSecretAccessKey")
.WithFirehoseStreamName("firehoseStreamName")
.WithFirehoseCompressData(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.updateNamespace(
new Gs2Log.UpdateNamespaceRequest()
.withNamespaceName("namespace-0001")
.withDescription("description1")
.withType("firehose")
.withGcpCredentialJson("{\"project_id\": \"gs2-dev\"}")
.withBigQueryDatasetName("dataset_0001")
.withLogExpireDays(3)
.withAwsRegion("awsRegion")
.withAwsAccessKeyId("awsAccessKeyId")
.withAwsSecretAccessKey("awsSecretAccessKey")
.withFirehoseStreamName("firehoseStreamName")
.withFirehoseCompressData(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.update_namespace(
log.UpdateNamespaceRequest()
.with_namespace_name('namespace-0001')
.with_description('description1')
.with_type('firehose')
.with_gcp_credential_json('{"project_id": "gs2-dev"}')
.with_big_query_dataset_name('dataset_0001')
.with_log_expire_days(3)
.with_aws_region('awsRegion')
.with_aws_access_key_id('awsAccessKeyId')
.with_aws_secret_access_key('awsSecretAccessKey')
.with_firehose_stream_name('firehoseStreamName')
.with_firehose_compress_data(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.update_namespace({
namespaceName="namespace-0001",
description="description1",
type="firehose",
gcpCredentialJson="{\"project_id\": \"gs2-dev\"}",
bigQueryDatasetName="dataset_0001",
logExpireDays=3,
awsRegion="awsRegion",
awsAccessKeyId="awsAccessKeyId",
awsSecretAccessKey="awsSecretAccessKey",
firehoseStreamName="firehoseStreamName",
firehoseCompressData=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
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['message'])
end
result = api_result.result
item = result.item;deleteNamespace
Delete namespace
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name |
Result
| Type | Description | |
|---|---|---|
| item | Namespace | Deleted 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.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\DeleteNamespaceRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->deleteNamespace(
(new DeleteNamespaceRequest())
->withNamespaceName("namespace-0001")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.DeleteNamespaceRequest;
import io.gs2.log.result.DeleteNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
DeleteNamespaceResult result = client.deleteNamespace(
new DeleteNamespaceRequest()
.withNamespaceName("namespace-0001")
);
Namespace item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.DeleteNamespaceResult> asyncResult = null;
yield return client.DeleteNamespace(
new Gs2.Gs2Log.Request.DeleteNamespaceRequest()
.WithNamespaceName("namespace-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.deleteNamespace(
new Gs2Log.DeleteNamespaceRequest()
.withNamespaceName("namespace-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.delete_namespace(
log.DeleteNamespaceRequest()
.with_namespace_name('namespace-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.delete_namespace({
namespaceName="namespace-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
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['message'])
end
result = api_result.result
item = result.item;getServiceVersion
Get version of microservice
Request
| Type | Condition | Required | Default | Value Limits | Description |
|---|
Result
| Type | Description | |
|---|---|---|
| item | string | Version |
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.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\GetServiceVersionRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->getServiceVersion(
(new GetServiceVersionRequest())
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.GetServiceVersionRequest;
import io.gs2.log.result.GetServiceVersionResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
GetServiceVersionResult result = client.getServiceVersion(
new GetServiceVersionRequest()
);
String item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.GetServiceVersionResult> asyncResult = null;
yield return client.GetServiceVersion(
new Gs2.Gs2Log.Request.GetServiceVersionRequest(),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.getServiceVersion(
new Gs2Log.GetServiceVersionRequest()
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.get_service_version(
log.GetServiceVersionRequest()
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.get_service_version({
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
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['message'])
end
result = api_result.result
item = result.item;queryAccessLog
Obtain list of access logs
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
| service | string | ~ 1024 chars | Types of Microservices | |||
| method | string | ~ 1024 chars | Microservice Methods | |||
| userId | string | ~ 128 chars | User Id | |||
| begin | long | ✓ | Difference from current time(-1 hours) | Search range start date and time (Unix time, milliseconds) | ||
| end | long | ✓ | Now | Search range end date and time (Unix time, milliseconds) | ||
| longTerm | bool | ✓ | false | Search logs for periods longer than 7 days | ||
| pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | |||
| limit | int | 30 | 1 ~ 100 | Number of data acquired | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| items | List<AccessLog> | List of Access Logs |
| nextPageToken | string | Page token to retrieve the rest of the listing |
| totalCount | long | Total number of query results |
| scanSize | long | Total 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.ScanSizeuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\QueryAccessLogRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->queryAccessLog(
(new QueryAccessLogRequest())
->withNamespaceName("namespace-0001")
->withService("account")
->withMethod("createAccount")
->withUserId("user-0001")
->withBegin(1473174000000)
->withEnd(1473177600000)
->withLongTerm(False)
->withPageToken(null)
->withLimit(null)
->withTimeOffsetToken(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
$totalCount = $result->getTotalCount();
$scanSize = $result->getScanSize();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.QueryAccessLogRequest;
import io.gs2.log.result.QueryAccessLogResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
QueryAccessLogResult result = client.queryAccessLog(
new QueryAccessLogRequest()
.withNamespaceName("namespace-0001")
.withService("account")
.withMethod("createAccount")
.withUserId("user-0001")
.withBegin(1473174000000L)
.withEnd(1473177600000L)
.withLongTerm(false)
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(null)
);
List<AccessLog> items = result.getItems();
String nextPageToken = result.getNextPageToken();
long totalCount = result.getTotalCount();
long scanSize = result.getScanSize();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.QueryAccessLogResult> asyncResult = null;
yield return client.QueryAccessLog(
new Gs2.Gs2Log.Request.QueryAccessLogRequest()
.WithNamespaceName("namespace-0001")
.WithService("account")
.WithMethod("createAccount")
.WithUserId("user-0001")
.WithBegin(1473174000000L)
.WithEnd(1473177600000L)
.WithLongTerm(false)
.WithPageToken(null)
.WithLimit(null)
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
var totalCount = result.TotalCount;
var scanSize = result.ScanSize;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.queryAccessLog(
new Gs2Log.QueryAccessLogRequest()
.withNamespaceName("namespace-0001")
.withService("account")
.withMethod("createAccount")
.withUserId("user-0001")
.withBegin(1473174000000)
.withEnd(1473177600000)
.withLongTerm(false)
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
const totalCount = result.getTotalCount();
const scanSize = result.getScanSize();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.query_access_log(
log.QueryAccessLogRequest()
.with_namespace_name('namespace-0001')
.with_service('account')
.with_method('createAccount')
.with_user_id('user-0001')
.with_begin(1473174000000)
.with_end(1473177600000)
.with_long_term(False)
.with_page_token(None)
.with_limit(None)
.with_time_offset_token(None)
)
items = result.items
next_page_token = result.next_page_token
total_count = result.total_count
scan_size = result.scan_size
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.query_access_log({
namespaceName="namespace-0001",
service="account",
method="createAccount",
userId="user-0001",
begin=1473174000000,
end=1473177600000,
longTerm=false,
pageToken=nil,
limit=nil,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
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['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
totalCount = result.totalCount;
scanSize = result.scanSize;countAccessLog
Obtain aggregate results of access logs
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
| service | bool | ✓ | false | Classify by microservice type | ||
| method | bool | ✓ | false | Classify by microservice method | ||
| userId | bool | ✓ | false | Classify by user ID | ||
| begin | long | ✓ | Difference from current time(-1 hours) | Search range start date and time (Unix time, milliseconds) | ||
| end | long | ✓ | Now | Search range end date and time (Unix time, milliseconds) | ||
| longTerm | bool | ✓ | false | Search logs for periods longer than 7 days | ||
| pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | |||
| limit | int | ✓ | 30 | 1 ~ 1000 | Number of data acquired | |
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| items | List<AccessLogCount> | List of Aggregated access log |
| nextPageToken | string | Page token to retrieve the rest of the listing |
| totalCount | long | Total number of query results |
| scanSize | long | Total 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.ScanSizeuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\CountAccessLogRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->countAccessLog(
(new CountAccessLogRequest())
->withNamespaceName("namespace-0001")
->withService("account")
->withMethod("createAccount")
->withUserId("user-0001")
->withBegin(1473174000000)
->withEnd(1473177600000)
->withLongTerm(False)
->withPageToken(null)
->withLimit(null)
->withTimeOffsetToken(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
$totalCount = $result->getTotalCount();
$scanSize = $result->getScanSize();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.CountAccessLogRequest;
import io.gs2.log.result.CountAccessLogResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
CountAccessLogResult result = client.countAccessLog(
new CountAccessLogRequest()
.withNamespaceName("namespace-0001")
.withService("account")
.withMethod("createAccount")
.withUserId("user-0001")
.withBegin(1473174000000L)
.withEnd(1473177600000L)
.withLongTerm(false)
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(null)
);
List<AccessLogCount> items = result.getItems();
String nextPageToken = result.getNextPageToken();
long totalCount = result.getTotalCount();
long scanSize = result.getScanSize();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.CountAccessLogResult> asyncResult = null;
yield return client.CountAccessLog(
new Gs2.Gs2Log.Request.CountAccessLogRequest()
.WithNamespaceName("namespace-0001")
.WithService("account")
.WithMethod("createAccount")
.WithUserId("user-0001")
.WithBegin(1473174000000L)
.WithEnd(1473177600000L)
.WithLongTerm(false)
.WithPageToken(null)
.WithLimit(null)
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
var totalCount = result.TotalCount;
var scanSize = result.ScanSize;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.countAccessLog(
new Gs2Log.CountAccessLogRequest()
.withNamespaceName("namespace-0001")
.withService("account")
.withMethod("createAccount")
.withUserId("user-0001")
.withBegin(1473174000000)
.withEnd(1473177600000)
.withLongTerm(false)
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
const totalCount = result.getTotalCount();
const scanSize = result.getScanSize();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.count_access_log(
log.CountAccessLogRequest()
.with_namespace_name('namespace-0001')
.with_service('account')
.with_method('createAccount')
.with_user_id('user-0001')
.with_begin(1473174000000)
.with_end(1473177600000)
.with_long_term(False)
.with_page_token(None)
.with_limit(None)
.with_time_offset_token(None)
)
items = result.items
next_page_token = result.next_page_token
total_count = result.total_count
scan_size = result.scan_size
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.count_access_log({
namespaceName="namespace-0001",
service="account",
method="createAccount",
userId="user-0001",
begin=1473174000000,
end=1473177600000,
longTerm=false,
pageToken=nil,
limit=nil,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
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['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
totalCount = result.totalCount;
scanSize = result.scanSize;queryIssueStampSheetLog
Obtain list of transaction issue logs
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
| service | string | ~ 1024 chars | Types of Microservices | |||
| method | string | ~ 1024 chars | Microservice Methods | |||
| userId | string | ~ 128 chars | User Id | |||
| action | string | ~ 1024 chars | Acquire Action | |||
| begin | long | ✓ | Difference from current time(-1 hours) | Search range start date and time (Unix time, milliseconds) | ||
| end | long | ✓ | Now | Search range end date and time (Unix time, milliseconds) | ||
| longTerm | bool | ✓ | false | Search logs for periods longer than 7 days | ||
| pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | |||
| limit | int | 30 | 1 ~ 100 | Number of data acquired | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| items | List<IssueStampSheetLog> | List of Transaction issue log |
| nextPageToken | string | Page token to retrieve the rest of the listing |
| totalCount | long | Total number of query results |
| scanSize | long | Total 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.ScanSizeuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\QueryIssueStampSheetLogRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->queryIssueStampSheetLog(
(new QueryIssueStampSheetLogRequest())
->withNamespaceName("namespace-0001")
->withService("showcase")
->withMethod("buy")
->withUserId("user-0001")
->withAction("Gs2Showcase:Buy")
->withBegin(1473174000000)
->withEnd(1473177600000)
->withLongTerm(False)
->withPageToken(null)
->withLimit(null)
->withTimeOffsetToken(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
$totalCount = $result->getTotalCount();
$scanSize = $result->getScanSize();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.QueryIssueStampSheetLogRequest;
import io.gs2.log.result.QueryIssueStampSheetLogResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
QueryIssueStampSheetLogResult result = client.queryIssueStampSheetLog(
new QueryIssueStampSheetLogRequest()
.withNamespaceName("namespace-0001")
.withService("showcase")
.withMethod("buy")
.withUserId("user-0001")
.withAction("Gs2Showcase:Buy")
.withBegin(1473174000000L)
.withEnd(1473177600000L)
.withLongTerm(false)
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(null)
);
List<IssueStampSheetLog> items = result.getItems();
String nextPageToken = result.getNextPageToken();
long totalCount = result.getTotalCount();
long scanSize = result.getScanSize();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.QueryIssueStampSheetLogResult> asyncResult = null;
yield return client.QueryIssueStampSheetLog(
new Gs2.Gs2Log.Request.QueryIssueStampSheetLogRequest()
.WithNamespaceName("namespace-0001")
.WithService("showcase")
.WithMethod("buy")
.WithUserId("user-0001")
.WithAction("Gs2Showcase:Buy")
.WithBegin(1473174000000L)
.WithEnd(1473177600000L)
.WithLongTerm(false)
.WithPageToken(null)
.WithLimit(null)
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
var totalCount = result.TotalCount;
var scanSize = result.ScanSize;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.queryIssueStampSheetLog(
new Gs2Log.QueryIssueStampSheetLogRequest()
.withNamespaceName("namespace-0001")
.withService("showcase")
.withMethod("buy")
.withUserId("user-0001")
.withAction("Gs2Showcase:Buy")
.withBegin(1473174000000)
.withEnd(1473177600000)
.withLongTerm(false)
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
const totalCount = result.getTotalCount();
const scanSize = result.getScanSize();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.query_issue_stamp_sheet_log(
log.QueryIssueStampSheetLogRequest()
.with_namespace_name('namespace-0001')
.with_service('showcase')
.with_method('buy')
.with_user_id('user-0001')
.with_action('Gs2Showcase:Buy')
.with_begin(1473174000000)
.with_end(1473177600000)
.with_long_term(False)
.with_page_token(None)
.with_limit(None)
.with_time_offset_token(None)
)
items = result.items
next_page_token = result.next_page_token
total_count = result.total_count
scan_size = result.scan_size
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.query_issue_stamp_sheet_log({
namespaceName="namespace-0001",
service="showcase",
method="buy",
userId="user-0001",
action="Gs2Showcase:Buy",
begin=1473174000000,
end=1473177600000,
longTerm=false,
pageToken=nil,
limit=nil,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
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['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
totalCount = result.totalCount;
scanSize = result.scanSize;countIssueStampSheetLog
Obtain list of transaction issue logs
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
| service | bool | ✓ | false | Classify by microservice type | ||
| method | bool | ✓ | false | Classify by microservice method | ||
| userId | bool | ✓ | false | Classify by user ID | ||
| action | bool | ✓ | false | Classify by acquire actions | ||
| begin | long | ✓ | Difference from current time(-1 hours) | Search range start date and time (Unix time, milliseconds) | ||
| end | long | ✓ | Now | Search range end date and time (Unix time, milliseconds) | ||
| longTerm | bool | ✓ | false | Search logs for periods longer than 7 days | ||
| pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | |||
| limit | int | ✓ | 30 | 1 ~ 1000 | Number of data acquired | |
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| items | List<IssueStampSheetLogCount> | List of Aggregated transaction issuance log |
| nextPageToken | string | Page token to retrieve the rest of the listing |
| totalCount | long | Total number of query results |
| scanSize | long | Total 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.ScanSizeuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\CountIssueStampSheetLogRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->countIssueStampSheetLog(
(new CountIssueStampSheetLogRequest())
->withNamespaceName("namespace-0001")
->withService("showcase")
->withMethod("buy")
->withUserId("user-0001")
->withAction("Gs2Showcase:Buy")
->withBegin(1473174000000)
->withEnd(1473177600000)
->withLongTerm(False)
->withPageToken(null)
->withLimit(null)
->withTimeOffsetToken(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
$totalCount = $result->getTotalCount();
$scanSize = $result->getScanSize();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.CountIssueStampSheetLogRequest;
import io.gs2.log.result.CountIssueStampSheetLogResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
CountIssueStampSheetLogResult result = client.countIssueStampSheetLog(
new CountIssueStampSheetLogRequest()
.withNamespaceName("namespace-0001")
.withService("showcase")
.withMethod("buy")
.withUserId("user-0001")
.withAction("Gs2Showcase:Buy")
.withBegin(1473174000000L)
.withEnd(1473177600000L)
.withLongTerm(false)
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(null)
);
List<IssueStampSheetLogCount> items = result.getItems();
String nextPageToken = result.getNextPageToken();
long totalCount = result.getTotalCount();
long scanSize = result.getScanSize();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.CountIssueStampSheetLogResult> asyncResult = null;
yield return client.CountIssueStampSheetLog(
new Gs2.Gs2Log.Request.CountIssueStampSheetLogRequest()
.WithNamespaceName("namespace-0001")
.WithService("showcase")
.WithMethod("buy")
.WithUserId("user-0001")
.WithAction("Gs2Showcase:Buy")
.WithBegin(1473174000000L)
.WithEnd(1473177600000L)
.WithLongTerm(false)
.WithPageToken(null)
.WithLimit(null)
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
var totalCount = result.TotalCount;
var scanSize = result.ScanSize;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.countIssueStampSheetLog(
new Gs2Log.CountIssueStampSheetLogRequest()
.withNamespaceName("namespace-0001")
.withService("showcase")
.withMethod("buy")
.withUserId("user-0001")
.withAction("Gs2Showcase:Buy")
.withBegin(1473174000000)
.withEnd(1473177600000)
.withLongTerm(false)
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
const totalCount = result.getTotalCount();
const scanSize = result.getScanSize();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.count_issue_stamp_sheet_log(
log.CountIssueStampSheetLogRequest()
.with_namespace_name('namespace-0001')
.with_service('showcase')
.with_method('buy')
.with_user_id('user-0001')
.with_action('Gs2Showcase:Buy')
.with_begin(1473174000000)
.with_end(1473177600000)
.with_long_term(False)
.with_page_token(None)
.with_limit(None)
.with_time_offset_token(None)
)
items = result.items
next_page_token = result.next_page_token
total_count = result.total_count
scan_size = result.scan_size
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.count_issue_stamp_sheet_log({
namespaceName="namespace-0001",
service="showcase",
method="buy",
userId="user-0001",
action="Gs2Showcase:Buy",
begin=1473174000000,
end=1473177600000,
longTerm=false,
pageToken=nil,
limit=nil,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
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['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
totalCount = result.totalCount;
scanSize = result.scanSize;queryExecuteStampSheetLog
Get list of transaction execution logs
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
| service | string | ~ 1024 chars | Types of Microservices | |||
| method | string | ~ 1024 chars | Microservice Methods | |||
| userId | string | ~ 128 chars | User Id | |||
| action | string | ~ 1024 chars | Acquire Action | |||
| begin | long | ✓ | Difference from current time(-1 hours) | Search range start date and time (Unix time, milliseconds) | ||
| end | long | ✓ | Now | Search range end date and time (Unix time, milliseconds) | ||
| longTerm | bool | ✓ | false | Search logs for periods longer than 7 days | ||
| pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | |||
| limit | int | 30 | 1 ~ 100 | Number of data acquired | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| items | List<ExecuteStampSheetLog> | List of Acquire actions execution logs |
| nextPageToken | string | Page token to retrieve the rest of the listing |
| totalCount | long | Total number of query results |
| scanSize | long | Total 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.ScanSizeuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\QueryExecuteStampSheetLogRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->queryExecuteStampSheetLog(
(new QueryExecuteStampSheetLogRequest())
->withNamespaceName("namespace-0001")
->withService("inventory")
->withMethod("acquireItemSetByUserId")
->withUserId("user-0001")
->withAction(null)
->withBegin(1473174000000)
->withEnd(1473177600000)
->withLongTerm(False)
->withPageToken(null)
->withLimit(null)
->withTimeOffsetToken(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
$totalCount = $result->getTotalCount();
$scanSize = $result->getScanSize();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.QueryExecuteStampSheetLogRequest;
import io.gs2.log.result.QueryExecuteStampSheetLogResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
QueryExecuteStampSheetLogResult result = client.queryExecuteStampSheetLog(
new QueryExecuteStampSheetLogRequest()
.withNamespaceName("namespace-0001")
.withService("inventory")
.withMethod("acquireItemSetByUserId")
.withUserId("user-0001")
.withAction(null)
.withBegin(1473174000000L)
.withEnd(1473177600000L)
.withLongTerm(false)
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(null)
);
List<ExecuteStampSheetLog> items = result.getItems();
String nextPageToken = result.getNextPageToken();
long totalCount = result.getTotalCount();
long scanSize = result.getScanSize();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.QueryExecuteStampSheetLogResult> asyncResult = null;
yield return client.QueryExecuteStampSheetLog(
new Gs2.Gs2Log.Request.QueryExecuteStampSheetLogRequest()
.WithNamespaceName("namespace-0001")
.WithService("inventory")
.WithMethod("acquireItemSetByUserId")
.WithUserId("user-0001")
.WithAction(null)
.WithBegin(1473174000000L)
.WithEnd(1473177600000L)
.WithLongTerm(false)
.WithPageToken(null)
.WithLimit(null)
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
var totalCount = result.TotalCount;
var scanSize = result.ScanSize;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.queryExecuteStampSheetLog(
new Gs2Log.QueryExecuteStampSheetLogRequest()
.withNamespaceName("namespace-0001")
.withService("inventory")
.withMethod("acquireItemSetByUserId")
.withUserId("user-0001")
.withAction(null)
.withBegin(1473174000000)
.withEnd(1473177600000)
.withLongTerm(false)
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
const totalCount = result.getTotalCount();
const scanSize = result.getScanSize();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.query_execute_stamp_sheet_log(
log.QueryExecuteStampSheetLogRequest()
.with_namespace_name('namespace-0001')
.with_service('inventory')
.with_method('acquireItemSetByUserId')
.with_user_id('user-0001')
.with_action(None)
.with_begin(1473174000000)
.with_end(1473177600000)
.with_long_term(False)
.with_page_token(None)
.with_limit(None)
.with_time_offset_token(None)
)
items = result.items
next_page_token = result.next_page_token
total_count = result.total_count
scan_size = result.scan_size
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.query_execute_stamp_sheet_log({
namespaceName="namespace-0001",
service="inventory",
method="acquireItemSetByUserId",
userId="user-0001",
action=nil,
begin=1473174000000,
end=1473177600000,
longTerm=false,
pageToken=nil,
limit=nil,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
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['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
totalCount = result.totalCount;
scanSize = result.scanSize;countExecuteStampSheetLog
Get list of transaction execution logs
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
| service | bool | ✓ | false | Classify by microservice type | ||
| method | bool | ✓ | false | Classify by microservice method | ||
| userId | bool | ✓ | false | Classify by user ID | ||
| action | bool | ✓ | false | Classify by acquire actions | ||
| begin | long | ✓ | Difference from current time(-1 hours) | Search range start date and time (Unix time, milliseconds) | ||
| end | long | ✓ | Now | Search range end date and time (Unix time, milliseconds) | ||
| longTerm | bool | ✓ | false | Search logs for periods longer than 7 days | ||
| pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | |||
| limit | int | ✓ | 30 | 1 ~ 1000 | Number of data acquired | |
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| items | List<ExecuteStampSheetLogCount> | List of Aggregated acquire actions execution |
| nextPageToken | string | Page token to retrieve the rest of the listing |
| totalCount | long | Total number of query results |
| scanSize | long | Total 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.ScanSizeuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\CountExecuteStampSheetLogRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->countExecuteStampSheetLog(
(new CountExecuteStampSheetLogRequest())
->withNamespaceName("namespace-0001")
->withService("inventory")
->withMethod("acquireItemSetByUserId")
->withUserId("user-0001")
->withAction(null)
->withBegin(1473174000000)
->withEnd(1473177600000)
->withLongTerm(False)
->withPageToken(null)
->withLimit(null)
->withTimeOffsetToken(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
$totalCount = $result->getTotalCount();
$scanSize = $result->getScanSize();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.CountExecuteStampSheetLogRequest;
import io.gs2.log.result.CountExecuteStampSheetLogResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
CountExecuteStampSheetLogResult result = client.countExecuteStampSheetLog(
new CountExecuteStampSheetLogRequest()
.withNamespaceName("namespace-0001")
.withService("inventory")
.withMethod("acquireItemSetByUserId")
.withUserId("user-0001")
.withAction(null)
.withBegin(1473174000000L)
.withEnd(1473177600000L)
.withLongTerm(false)
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(null)
);
List<ExecuteStampSheetLogCount> items = result.getItems();
String nextPageToken = result.getNextPageToken();
long totalCount = result.getTotalCount();
long scanSize = result.getScanSize();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.CountExecuteStampSheetLogResult> asyncResult = null;
yield return client.CountExecuteStampSheetLog(
new Gs2.Gs2Log.Request.CountExecuteStampSheetLogRequest()
.WithNamespaceName("namespace-0001")
.WithService("inventory")
.WithMethod("acquireItemSetByUserId")
.WithUserId("user-0001")
.WithAction(null)
.WithBegin(1473174000000L)
.WithEnd(1473177600000L)
.WithLongTerm(false)
.WithPageToken(null)
.WithLimit(null)
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
var totalCount = result.TotalCount;
var scanSize = result.ScanSize;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.countExecuteStampSheetLog(
new Gs2Log.CountExecuteStampSheetLogRequest()
.withNamespaceName("namespace-0001")
.withService("inventory")
.withMethod("acquireItemSetByUserId")
.withUserId("user-0001")
.withAction(null)
.withBegin(1473174000000)
.withEnd(1473177600000)
.withLongTerm(false)
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
const totalCount = result.getTotalCount();
const scanSize = result.getScanSize();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.count_execute_stamp_sheet_log(
log.CountExecuteStampSheetLogRequest()
.with_namespace_name('namespace-0001')
.with_service('inventory')
.with_method('acquireItemSetByUserId')
.with_user_id('user-0001')
.with_action(None)
.with_begin(1473174000000)
.with_end(1473177600000)
.with_long_term(False)
.with_page_token(None)
.with_limit(None)
.with_time_offset_token(None)
)
items = result.items
next_page_token = result.next_page_token
total_count = result.total_count
scan_size = result.scan_size
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.count_execute_stamp_sheet_log({
namespaceName="namespace-0001",
service="inventory",
method="acquireItemSetByUserId",
userId="user-0001",
action=nil,
begin=1473174000000,
end=1473177600000,
longTerm=false,
pageToken=nil,
limit=nil,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
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['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
totalCount = result.totalCount;
scanSize = result.scanSize;queryExecuteStampTaskLog
Obtain list of stamp task execution logs
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
| service | string | ~ 1024 chars | Types of Microservices | |||
| method | string | ~ 1024 chars | Microservice Methods | |||
| userId | string | ~ 128 chars | User Id | |||
| action | string | ~ 1024 chars | Acquire Action | |||
| begin | long | ✓ | Difference from current time(-1 hours) | Search range start date and time (Unix time, milliseconds) | ||
| end | long | ✓ | Now | Search range end date and time (Unix time, milliseconds) | ||
| longTerm | bool | ✓ | false | Search logs for periods longer than 7 days | ||
| pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | |||
| limit | int | 30 | 1 ~ 100 | Number of data acquired | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| items | List<ExecuteStampTaskLog> | List of Stamp task execution log |
| nextPageToken | string | Page token to retrieve the rest of the listing |
| totalCount | long | Total number of query results |
| scanSize | long | Total 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.ScanSizeuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\QueryExecuteStampTaskLogRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->queryExecuteStampTaskLog(
(new QueryExecuteStampTaskLogRequest())
->withNamespaceName("namespace-0001")
->withService("inventory")
->withMethod("consumeItemSetByUserId")
->withUserId("user-0001")
->withAction(null)
->withBegin(1473174000000)
->withEnd(1473177600000)
->withLongTerm(False)
->withPageToken(null)
->withLimit(null)
->withTimeOffsetToken(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
$totalCount = $result->getTotalCount();
$scanSize = $result->getScanSize();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.QueryExecuteStampTaskLogRequest;
import io.gs2.log.result.QueryExecuteStampTaskLogResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
QueryExecuteStampTaskLogResult result = client.queryExecuteStampTaskLog(
new QueryExecuteStampTaskLogRequest()
.withNamespaceName("namespace-0001")
.withService("inventory")
.withMethod("consumeItemSetByUserId")
.withUserId("user-0001")
.withAction(null)
.withBegin(1473174000000L)
.withEnd(1473177600000L)
.withLongTerm(false)
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(null)
);
List<ExecuteStampTaskLog> items = result.getItems();
String nextPageToken = result.getNextPageToken();
long totalCount = result.getTotalCount();
long scanSize = result.getScanSize();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.QueryExecuteStampTaskLogResult> asyncResult = null;
yield return client.QueryExecuteStampTaskLog(
new Gs2.Gs2Log.Request.QueryExecuteStampTaskLogRequest()
.WithNamespaceName("namespace-0001")
.WithService("inventory")
.WithMethod("consumeItemSetByUserId")
.WithUserId("user-0001")
.WithAction(null)
.WithBegin(1473174000000L)
.WithEnd(1473177600000L)
.WithLongTerm(false)
.WithPageToken(null)
.WithLimit(null)
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
var totalCount = result.TotalCount;
var scanSize = result.ScanSize;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.queryExecuteStampTaskLog(
new Gs2Log.QueryExecuteStampTaskLogRequest()
.withNamespaceName("namespace-0001")
.withService("inventory")
.withMethod("consumeItemSetByUserId")
.withUserId("user-0001")
.withAction(null)
.withBegin(1473174000000)
.withEnd(1473177600000)
.withLongTerm(false)
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
const totalCount = result.getTotalCount();
const scanSize = result.getScanSize();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.query_execute_stamp_task_log(
log.QueryExecuteStampTaskLogRequest()
.with_namespace_name('namespace-0001')
.with_service('inventory')
.with_method('consumeItemSetByUserId')
.with_user_id('user-0001')
.with_action(None)
.with_begin(1473174000000)
.with_end(1473177600000)
.with_long_term(False)
.with_page_token(None)
.with_limit(None)
.with_time_offset_token(None)
)
items = result.items
next_page_token = result.next_page_token
total_count = result.total_count
scan_size = result.scan_size
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.query_execute_stamp_task_log({
namespaceName="namespace-0001",
service="inventory",
method="consumeItemSetByUserId",
userId="user-0001",
action=nil,
begin=1473174000000,
end=1473177600000,
longTerm=false,
pageToken=nil,
limit=nil,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
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['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
totalCount = result.totalCount;
scanSize = result.scanSize;countExecuteStampTaskLog
Obtain list of stamp task execution logs
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
| service | bool | ✓ | false | Classify by microservice type | ||
| method | bool | ✓ | false | Classify by microservice method | ||
| userId | bool | ✓ | false | Classify by user ID | ||
| action | bool | ✓ | false | Classify by acquire actions | ||
| begin | long | ✓ | Difference from current time(-1 hours) | Search range start date and time (Unix time, milliseconds) | ||
| end | long | ✓ | Now | Search range end date and time (Unix time, milliseconds) | ||
| longTerm | bool | ✓ | false | Search logs for periods longer than 7 days | ||
| pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | |||
| limit | int | ✓ | 30 | 1 ~ 1000 | Number of data acquired | |
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| items | List<ExecuteStampTaskLogCount> | List of Aggregated stamp task execution log |
| nextPageToken | string | Page token to retrieve the rest of the listing |
| totalCount | long | Total number of query results |
| scanSize | long | Total 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.ScanSizeuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\CountExecuteStampTaskLogRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->countExecuteStampTaskLog(
(new CountExecuteStampTaskLogRequest())
->withNamespaceName("namespace-0001")
->withService("inventory")
->withMethod("consumeItemSetByUserId")
->withUserId("user-0001")
->withAction(null)
->withBegin(1473174000000)
->withEnd(1473177600000)
->withLongTerm(False)
->withPageToken(null)
->withLimit(null)
->withTimeOffsetToken(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
$totalCount = $result->getTotalCount();
$scanSize = $result->getScanSize();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.CountExecuteStampTaskLogRequest;
import io.gs2.log.result.CountExecuteStampTaskLogResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
CountExecuteStampTaskLogResult result = client.countExecuteStampTaskLog(
new CountExecuteStampTaskLogRequest()
.withNamespaceName("namespace-0001")
.withService("inventory")
.withMethod("consumeItemSetByUserId")
.withUserId("user-0001")
.withAction(null)
.withBegin(1473174000000L)
.withEnd(1473177600000L)
.withLongTerm(false)
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(null)
);
List<ExecuteStampTaskLogCount> items = result.getItems();
String nextPageToken = result.getNextPageToken();
long totalCount = result.getTotalCount();
long scanSize = result.getScanSize();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.CountExecuteStampTaskLogResult> asyncResult = null;
yield return client.CountExecuteStampTaskLog(
new Gs2.Gs2Log.Request.CountExecuteStampTaskLogRequest()
.WithNamespaceName("namespace-0001")
.WithService("inventory")
.WithMethod("consumeItemSetByUserId")
.WithUserId("user-0001")
.WithAction(null)
.WithBegin(1473174000000L)
.WithEnd(1473177600000L)
.WithLongTerm(false)
.WithPageToken(null)
.WithLimit(null)
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
var totalCount = result.TotalCount;
var scanSize = result.ScanSize;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.countExecuteStampTaskLog(
new Gs2Log.CountExecuteStampTaskLogRequest()
.withNamespaceName("namespace-0001")
.withService("inventory")
.withMethod("consumeItemSetByUserId")
.withUserId("user-0001")
.withAction(null)
.withBegin(1473174000000)
.withEnd(1473177600000)
.withLongTerm(false)
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
const totalCount = result.getTotalCount();
const scanSize = result.getScanSize();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.count_execute_stamp_task_log(
log.CountExecuteStampTaskLogRequest()
.with_namespace_name('namespace-0001')
.with_service('inventory')
.with_method('consumeItemSetByUserId')
.with_user_id('user-0001')
.with_action(None)
.with_begin(1473174000000)
.with_end(1473177600000)
.with_long_term(False)
.with_page_token(None)
.with_limit(None)
.with_time_offset_token(None)
)
items = result.items
next_page_token = result.next_page_token
total_count = result.total_count
scan_size = result.scan_size
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.count_execute_stamp_task_log({
namespaceName="namespace-0001",
service="inventory",
method="consumeItemSetByUserId",
userId="user-0001",
action=nil,
begin=1473174000000,
end=1473177600000,
longTerm=false,
pageToken=nil,
limit=nil,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
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['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
totalCount = result.totalCount;
scanSize = result.scanSize;queryInGameLog
Get list of in-game logs
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
| userId | string | ~ 128 chars | User Id | |||
| tags | List<InGameLogTag> | [] | 0 ~ 20 items | Tags | ||
| begin | long | ✓ | Difference from current time(-1 hours) | Search range start date and time (Unix time, milliseconds) | ||
| end | long | ✓ | Difference from current time(1 hours) | Search range end date and time (Unix time, milliseconds) | ||
| longTerm | bool | ✓ | false | Search logs for periods longer than 7 days | ||
| pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | |||
| limit | int | 30 | 1 ~ 100 | Number of data acquired | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| items | List<InGameLog> | List of in-game logs |
| nextPageToken | string | Page token to retrieve the rest of the listing |
| totalCount | long | Total number of query results |
| scanSize | long | Total 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.ScanSizeuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\QueryInGameLogRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->queryInGameLog(
(new QueryInGameLogRequest())
->withNamespaceName("namespace-0001")
->withUserId("user-0001")
->withTags([
(new InGameLogTag())
->withKey("tag1")
->withValue("value1"),
(new InGameLogTag())
->withKey("tag2")
->withValue("value2"),
])
->withBegin(1473174000000)
->withEnd(1473177600000)
->withLongTerm(False)
->withPageToken(null)
->withLimit(null)
->withTimeOffsetToken(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
$totalCount = $result->getTotalCount();
$scanSize = $result->getScanSize();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.QueryInGameLogRequest;
import io.gs2.log.result.QueryInGameLogResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
QueryInGameLogResult result = client.queryInGameLog(
new QueryInGameLogRequest()
.withNamespaceName("namespace-0001")
.withUserId("user-0001")
.withTags(Arrays.asList(
new InGameLogTag()
.withKey("tag1")
.withValue("value1"),
new InGameLogTag()
.withKey("tag2")
.withValue("value2")
))
.withBegin(1473174000000L)
.withEnd(1473177600000L)
.withLongTerm(false)
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(null)
);
List<InGameLog> items = result.getItems();
String nextPageToken = result.getNextPageToken();
long totalCount = result.getTotalCount();
long scanSize = result.getScanSize();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.QueryInGameLogResult> asyncResult = null;
yield return client.QueryInGameLog(
new Gs2.Gs2Log.Request.QueryInGameLogRequest()
.WithNamespaceName("namespace-0001")
.WithUserId("user-0001")
.WithTags(new Gs2.Gs2Log.Model.InGameLogTag[] {
new Gs2.Gs2Log.Model.InGameLogTag()
.WithKey("tag1")
.WithValue("value1"),
new Gs2.Gs2Log.Model.InGameLogTag()
.WithKey("tag2")
.WithValue("value2"),
})
.WithBegin(1473174000000L)
.WithEnd(1473177600000L)
.WithLongTerm(false)
.WithPageToken(null)
.WithLimit(null)
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
var totalCount = result.TotalCount;
var scanSize = result.ScanSize;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.queryInGameLog(
new Gs2Log.QueryInGameLogRequest()
.withNamespaceName("namespace-0001")
.withUserId("user-0001")
.withTags([
new Gs2Log.model.InGameLogTag()
.withKey("tag1")
.withValue("value1"),
new Gs2Log.model.InGameLogTag()
.withKey("tag2")
.withValue("value2"),
])
.withBegin(1473174000000)
.withEnd(1473177600000)
.withLongTerm(false)
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
const totalCount = result.getTotalCount();
const scanSize = result.getScanSize();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.query_in_game_log(
log.QueryInGameLogRequest()
.with_namespace_name('namespace-0001')
.with_user_id('user-0001')
.with_tags([
log.InGameLogTag()
.with_key('tag1')
.with_value('value1'),
log.InGameLogTag()
.with_key('tag2')
.with_value('value2'),
])
.with_begin(1473174000000)
.with_end(1473177600000)
.with_long_term(False)
.with_page_token(None)
.with_limit(None)
.with_time_offset_token(None)
)
items = result.items
next_page_token = result.next_page_token
total_count = result.total_count
scan_size = result.scan_size
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.query_in_game_log({
namespaceName="namespace-0001",
userId="user-0001",
tags={
{
key="tag1",
value="value1",
},
{
key="tag2",
value="value2",
}
},
begin=1473174000000,
end=1473177600000,
longTerm=false,
pageToken=nil,
limit=nil,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
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['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
totalCount = result.totalCount;
scanSize = result.scanSize;sendInGameLog
Send in-game log
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
| accessToken | string | ~ 128 chars | Access token | |||
| tags | List<InGameLogTag> | [] | 0 ~ 20 items | Tags | ||
| payload | string | ✓ | ~ 10485760 chars | Payload in JSON format |
Result
| Type | Description | |
|---|---|---|
| item | InGameLog | In-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.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\SendInGameLogRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->sendInGameLog(
(new SendInGameLogRequest())
->withNamespaceName("namespace-0001")
->withAccessToken("accessToken-0001")
->withTags([
(new InGameLogTag())
->withKey("tag1")
->withValue("value1"),
(new InGameLogTag())
->withKey("tag2")
->withValue("value2"),
])
->withPayload("{\"category\": \"use-item\", \"count\": 1, \"itemId\": \"item-0001\"}")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.SendInGameLogRequest;
import io.gs2.log.result.SendInGameLogResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
SendInGameLogResult result = client.sendInGameLog(
new SendInGameLogRequest()
.withNamespaceName("namespace-0001")
.withAccessToken("accessToken-0001")
.withTags(Arrays.asList(
new InGameLogTag()
.withKey("tag1")
.withValue("value1"),
new InGameLogTag()
.withKey("tag2")
.withValue("value2")
))
.withPayload("{\"category\": \"use-item\", \"count\": 1, \"itemId\": \"item-0001\"}")
);
InGameLog item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.SendInGameLogResult> asyncResult = null;
yield return client.SendInGameLog(
new Gs2.Gs2Log.Request.SendInGameLogRequest()
.WithNamespaceName("namespace-0001")
.WithAccessToken("accessToken-0001")
.WithTags(new Gs2.Gs2Log.Model.InGameLogTag[] {
new Gs2.Gs2Log.Model.InGameLogTag()
.WithKey("tag1")
.WithValue("value1"),
new Gs2.Gs2Log.Model.InGameLogTag()
.WithKey("tag2")
.WithValue("value2"),
})
.WithPayload("{\"category\": \"use-item\", \"count\": 1, \"itemId\": \"item-0001\"}"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.sendInGameLog(
new Gs2Log.SendInGameLogRequest()
.withNamespaceName("namespace-0001")
.withAccessToken("accessToken-0001")
.withTags([
new Gs2Log.model.InGameLogTag()
.withKey("tag1")
.withValue("value1"),
new Gs2Log.model.InGameLogTag()
.withKey("tag2")
.withValue("value2"),
])
.withPayload("{\"category\": \"use-item\", \"count\": 1, \"itemId\": \"item-0001\"}")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.send_in_game_log(
log.SendInGameLogRequest()
.with_namespace_name('namespace-0001')
.with_access_token('accessToken-0001')
.with_tags([
log.InGameLogTag()
.with_key('tag1')
.with_value('value1'),
log.InGameLogTag()
.with_key('tag2')
.with_value('value2'),
])
.with_payload('{"category": "use-item", "count": 1, "itemId": "item-0001"}')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.send_in_game_log({
namespaceName="namespace-0001",
accessToken="accessToken-0001",
tags={
{
key="tag1",
value="value1",
},
{
key="tag2",
value="value2",
}
},
payload="{\"category\": \"use-item\", \"count\": 1, \"itemId\": \"item-0001\"}",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
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['message'])
end
result = api_result.result
item = result.item;sendInGameLogByUserId
Send in-game log by specifying user ID
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
| userId | string | ~ 128 chars | User Id | |||
| tags | List<InGameLogTag> | [] | 0 ~ 20 items | Tags | ||
| payload | string | ✓ | ~ 10485760 chars | Payload in JSON format | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| item | InGameLog | In-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.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\SendInGameLogByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->sendInGameLogByUserId(
(new SendInGameLogByUserIdRequest())
->withNamespaceName("namespace-0001")
->withUserId("user-0001")
->withTags([
(new InGameLogTag())
->withKey("tag1")
->withValue("value1"),
(new InGameLogTag())
->withKey("tag2")
->withValue("value2"),
])
->withPayload("{\"category\": \"use-item\", \"count\": 1, \"itemId\": \"item-0001\"}")
->withTimeOffsetToken(null)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.SendInGameLogByUserIdRequest;
import io.gs2.log.result.SendInGameLogByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
SendInGameLogByUserIdResult result = client.sendInGameLogByUserId(
new SendInGameLogByUserIdRequest()
.withNamespaceName("namespace-0001")
.withUserId("user-0001")
.withTags(Arrays.asList(
new InGameLogTag()
.withKey("tag1")
.withValue("value1"),
new InGameLogTag()
.withKey("tag2")
.withValue("value2")
))
.withPayload("{\"category\": \"use-item\", \"count\": 1, \"itemId\": \"item-0001\"}")
.withTimeOffsetToken(null)
);
InGameLog item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.SendInGameLogByUserIdResult> asyncResult = null;
yield return client.SendInGameLogByUserId(
new Gs2.Gs2Log.Request.SendInGameLogByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithUserId("user-0001")
.WithTags(new Gs2.Gs2Log.Model.InGameLogTag[] {
new Gs2.Gs2Log.Model.InGameLogTag()
.WithKey("tag1")
.WithValue("value1"),
new Gs2.Gs2Log.Model.InGameLogTag()
.WithKey("tag2")
.WithValue("value2"),
})
.WithPayload("{\"category\": \"use-item\", \"count\": 1, \"itemId\": \"item-0001\"}")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.sendInGameLogByUserId(
new Gs2Log.SendInGameLogByUserIdRequest()
.withNamespaceName("namespace-0001")
.withUserId("user-0001")
.withTags([
new Gs2Log.model.InGameLogTag()
.withKey("tag1")
.withValue("value1"),
new Gs2Log.model.InGameLogTag()
.withKey("tag2")
.withValue("value2"),
])
.withPayload("{\"category\": \"use-item\", \"count\": 1, \"itemId\": \"item-0001\"}")
.withTimeOffsetToken(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.send_in_game_log_by_user_id(
log.SendInGameLogByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_user_id('user-0001')
.with_tags([
log.InGameLogTag()
.with_key('tag1')
.with_value('value1'),
log.InGameLogTag()
.with_key('tag2')
.with_value('value2'),
])
.with_payload('{"category": "use-item", "count": 1, "itemId": "item-0001"}')
.with_time_offset_token(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.send_in_game_log_by_user_id({
namespaceName="namespace-0001",
userId="user-0001",
tags={
{
key="tag1",
value="value1",
},
{
key="tag2",
value="value2",
}
},
payload="{\"category\": \"use-item\", \"count\": 1, \"itemId\": \"item-0001\"}",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
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['message'])
end
result = api_result.result
item = result.item;queryAccessLogWithTelemetry
Get a list of access logs with telemetry
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
| userId | string | ~ 128 chars | User Id | |||
| begin | long | ✓ | Difference from current time(-1 hours) | Search range start date and time (Unix time, milliseconds) | ||
| end | long | ✓ | Now | Search range end date and time (Unix time, milliseconds) | ||
| longTerm | bool | ✓ | false | Search logs for periods longer than 7 days | ||
| pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | |||
| limit | int | ✓ | 30 | 1 ~ 1000 | Number of data acquired | |
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| items | List<AccessLogWithTelemetry> | List of Access Logs |
| nextPageToken | string | Page token to retrieve the rest of the listing |
| totalCount | long | Total number of query results |
| scanSize | long | Total 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.ScanSizeuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\QueryAccessLogWithTelemetryRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->queryAccessLogWithTelemetry(
(new QueryAccessLogWithTelemetryRequest())
->withNamespaceName("namespace-0001")
->withUserId("user-0001")
->withBegin(1473174000000)
->withEnd(1473177600000)
->withLongTerm(False)
->withPageToken(null)
->withLimit(null)
->withTimeOffsetToken(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
$totalCount = $result->getTotalCount();
$scanSize = $result->getScanSize();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.QueryAccessLogWithTelemetryRequest;
import io.gs2.log.result.QueryAccessLogWithTelemetryResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
QueryAccessLogWithTelemetryResult result = client.queryAccessLogWithTelemetry(
new QueryAccessLogWithTelemetryRequest()
.withNamespaceName("namespace-0001")
.withUserId("user-0001")
.withBegin(1473174000000L)
.withEnd(1473177600000L)
.withLongTerm(false)
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(null)
);
List<AccessLogWithTelemetry> items = result.getItems();
String nextPageToken = result.getNextPageToken();
long totalCount = result.getTotalCount();
long scanSize = result.getScanSize();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.QueryAccessLogWithTelemetryResult> asyncResult = null;
yield return client.QueryAccessLogWithTelemetry(
new Gs2.Gs2Log.Request.QueryAccessLogWithTelemetryRequest()
.WithNamespaceName("namespace-0001")
.WithUserId("user-0001")
.WithBegin(1473174000000L)
.WithEnd(1473177600000L)
.WithLongTerm(false)
.WithPageToken(null)
.WithLimit(null)
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
var totalCount = result.TotalCount;
var scanSize = result.ScanSize;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.queryAccessLogWithTelemetry(
new Gs2Log.QueryAccessLogWithTelemetryRequest()
.withNamespaceName("namespace-0001")
.withUserId("user-0001")
.withBegin(1473174000000)
.withEnd(1473177600000)
.withLongTerm(false)
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
const totalCount = result.getTotalCount();
const scanSize = result.getScanSize();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.query_access_log_with_telemetry(
log.QueryAccessLogWithTelemetryRequest()
.with_namespace_name('namespace-0001')
.with_user_id('user-0001')
.with_begin(1473174000000)
.with_end(1473177600000)
.with_long_term(False)
.with_page_token(None)
.with_limit(None)
.with_time_offset_token(None)
)
items = result.items
next_page_token = result.next_page_token
total_count = result.total_count
scan_size = result.scan_size
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.query_access_log_with_telemetry({
namespaceName="namespace-0001",
userId="user-0001",
begin=1473174000000,
end=1473177600000,
longTerm=false,
pageToken=nil,
limit=nil,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
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['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
totalCount = result.totalCount;
scanSize = result.scanSize;describeInsights
Obtain list of insights
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
| pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | |||
| limit | int | ✓ | 30 | 1 ~ 1000 | Number of data acquired |
Result
| Type | Description | |
|---|---|---|
| items | List<Insight> | List of GS2-Insights |
| nextPageToken | string | Page 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.NextPageTokenuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\DescribeInsightsRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->describeInsights(
(new DescribeInsightsRequest())
->withNamespaceName("namespace-0001")
->withPageToken(null)
->withLimit(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.DescribeInsightsRequest;
import io.gs2.log.result.DescribeInsightsResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
DescribeInsightsResult result = client.describeInsights(
new DescribeInsightsRequest()
.withNamespaceName("namespace-0001")
.withPageToken(null)
.withLimit(null)
);
List<Insight> items = result.getItems();
String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.DescribeInsightsResult> asyncResult = null;
yield return client.DescribeInsights(
new Gs2.Gs2Log.Request.DescribeInsightsRequest()
.WithNamespaceName("namespace-0001")
.WithPageToken(null)
.WithLimit(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.describeInsights(
new Gs2Log.DescribeInsightsRequest()
.withNamespaceName("namespace-0001")
.withPageToken(null)
.withLimit(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.describe_insights(
log.DescribeInsightsRequest()
.with_namespace_name('namespace-0001')
.with_page_token(None)
.with_limit(None)
)
items = result.items
next_page_token = result.next_page_token
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.describe_insights({
namespaceName="namespace-0001",
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
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['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;createInsight
Create insight
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name |
Result
| Type | Description | |
|---|---|---|
| item | Insight | GS2-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.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\CreateInsightRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->createInsight(
(new CreateInsightRequest())
->withNamespaceName("namespace-0001")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.CreateInsightRequest;
import io.gs2.log.result.CreateInsightResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
CreateInsightResult result = client.createInsight(
new CreateInsightRequest()
.withNamespaceName("namespace-0001")
);
Insight item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.CreateInsightResult> asyncResult = null;
yield return client.CreateInsight(
new Gs2.Gs2Log.Request.CreateInsightRequest()
.WithNamespaceName("namespace-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.createInsight(
new Gs2Log.CreateInsightRequest()
.withNamespaceName("namespace-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.create_insight(
log.CreateInsightRequest()
.with_namespace_name('namespace-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.create_insight({
namespaceName="namespace-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
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['message'])
end
result = api_result.result
item = result.item;getInsight
Obtain a insight
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
| insightName | string | ✓ | UUID | ~ 36 chars | Name |
Result
| Type | Description | |
|---|---|---|
| item | Insight | GS2-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.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\GetInsightRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->getInsight(
(new GetInsightRequest())
->withNamespaceName("namespace-0001")
->withInsightName("insight1-0001")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.GetInsightRequest;
import io.gs2.log.result.GetInsightResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
GetInsightResult result = client.getInsight(
new GetInsightRequest()
.withNamespaceName("namespace-0001")
.withInsightName("insight1-0001")
);
Insight item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.GetInsightResult> asyncResult = null;
yield return client.GetInsight(
new Gs2.Gs2Log.Request.GetInsightRequest()
.WithNamespaceName("namespace-0001")
.WithInsightName("insight1-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.getInsight(
new Gs2Log.GetInsightRequest()
.withNamespaceName("namespace-0001")
.withInsightName("insight1-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.get_insight(
log.GetInsightRequest()
.with_namespace_name('namespace-0001')
.with_insight_name('insight1-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.get_insight({
namespaceName="namespace-0001",
insightName="insight1-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
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['message'])
end
result = api_result.result
item = result.item;deleteInsight
Delete a insight
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
| insightName | string | ✓ | UUID | ~ 36 chars | Name |
Result
| Type | Description | |
|---|---|---|
| item | Insight | GS2-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.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\DeleteInsightRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2LogRestClient(
$session
);
try {
$result = $client->deleteInsight(
(new DeleteInsightRequest())
->withNamespaceName("namespace-0001")
->withInsightName("insight1-0001")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.log.rest.Gs2LogRestClient;
import io.gs2.log.request.DeleteInsightRequest;
import io.gs2.log.result.DeleteInsightResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2LogRestClient client = new Gs2LogRestClient(session);
try {
DeleteInsightResult result = client.deleteInsight(
new DeleteInsightRequest()
.withNamespaceName("namespace-0001")
.withInsightName("insight1-0001")
);
Insight item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2LogRestClient(session);
AsyncResult<Gs2.Gs2Log.Result.DeleteInsightResult> asyncResult = null;
yield return client.DeleteInsight(
new Gs2.Gs2Log.Request.DeleteInsightRequest()
.WithNamespaceName("namespace-0001")
.WithInsightName("insight1-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Log from '@/gs2/log';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Log.Gs2LogRestClient(session);
try {
const result = await client.deleteInsight(
new Gs2Log.DeleteInsightRequest()
.withNamespaceName("namespace-0001")
.withInsightName("insight1-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import log
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = log.Gs2LogRestClient(session)
try:
result = client.delete_insight(
log.DeleteInsightRequest()
.with_namespace_name('namespace-0001')
.with_insight_name('insight1-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('log')
api_result = client.delete_insight({
namespaceName="namespace-0001",
insightName="insight1-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
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['message'])
end
result = api_result.result
item = result.item;