NAV
go python java php typescript csharp GS2-Script

GS2-Log

GS2-SDK のリファレンス

モデル

Namespace

ネームスペースは一つのプロジェクトで同じサービスを異なる用途で複数利用できるようにするための仕組みです。 GS2 のサービスは基本的にネームスペースというレイヤーがあり、ネームスペースが異なれば同じサービスでもまったく別のデータ空間として取り扱われます。

そのため、各サービスの利用を開始するにあたってネームスペースを作成する必要があります。

説明
namespaceId string ネームスペースGRN
name string ネームスペース名
description string 説明文
type string ログの書き出し方法
gcpCredentialJson string GCPのクレデンシャル
bigQueryDatasetName string BigQueryのデータセット名
logExpireDays int ログの保存期間(日)
awsRegion string AWSのリージョン
awsAccessKeyId string AWSのアクセスキーID
awsSecretAccessKey string AWSのシークレットアクセスキー
firehoseStreamName string Kinesis Firehose のストリーム名
createdAt long 作成日時
updatedAt long 最終更新日時

AccessLog

説明
timestamp long 日時
requestId string リクエストID
service string マイクロサービスの種類
method string マイクロサービスのメソッド
userId string ユーザーID
request string リクエストパラメータ
result string 応答内容

AccessLogCount

説明
service string マイクロサービスの種類
method string マイクロサービスのメソッド
userId string ユーザーID
count long 回数

IssueStampSheetLog

説明
timestamp long 日時
transactionId string トランザクションID
service string マイクロサービスの種類
method string マイクロサービスのメソッド
userId string ユーザーID
action string 報酬アクション
args string 引数
tasks string スタンプタスク

IssueStampSheetLogCount

説明
service string マイクロサービスの種類
method string マイクロサービスのメソッド
userId string ユーザーID
action string 報酬アクション
count long 回数

ExecuteStampSheetLog

説明
timestamp long 日時
transactionId string トランザクションID
service string マイクロサービスの種類
method string マイクロサービスのメソッド
userId string ユーザーID
action string 報酬アクション
args string 引数

ExecuteStampSheetLogCount

説明
service string マイクロサービスの種類
method string マイクロサービスのメソッド
userId string ユーザーID
action string 報酬アクション
count long 回数

ExecuteStampTaskLog

説明
timestamp long 日時
taskId string タスクID
service string マイクロサービスの種類
method string マイクロサービスのメソッド
userId string ユーザーID
action string 報酬アクション
args string 引数

ExecuteStampTaskLogCount

説明
service string マイクロサービスの種類
method string マイクロサービスのメソッド
userId string ユーザーID
action string 報酬アクション
count long 回数

メソッド

describeNamespaces

describeNamespaces

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/log"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := log.Gs2LogRestClient{
    Session: &session,
}
result, err := client.DescribeNamespaces(
    &log.DescribeNamespacesRequest {
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\DescribeNamespacesRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Log.Gs2LogRestClient;
using Gs2.Gs2Log.Request.DescribeNamespacesRequest;
using Gs2.Gs2Log.Result.DescribeNamespacesResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LogRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.describeNamespaces(
    new 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(undefined)
            .withLimit(undefined)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import log

const session = new core.Gs2RestSession(
    "ap-northeast-1",
    new core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
)
await session.connect()
client = new log.Gs2LogRestClient(session)

try:
    result = client.describe_namespaces(
        new log.DescribeNamespacesRequest()
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('log')

api_result = client.describe_namespaces({
    pageToken=nil,
    limit=nil,
});

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

ネームスペースの一覧を取得

Request

必須 デフォルト 値の制限 説明
pageToken string ~ 1024文字 データの取得を開始する位置を指定するトークン
limit int 30 1 ~ 1000 データの取得件数

Result

説明
items Namespace[] ネームスペースのリスト
nextPageToken string リストの続きを取得するためのページトークン

createNamespace

createNamespace

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("namespace1"),
        Description: nil,
        Type: pointy.String("gs2"),
        GcpCredentialJson: pointy.String("{\"project\": \"test\"}"),
        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"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\CreateNamespaceRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->createNamespace(
        (new CreateNamespaceRequest())
            ->withName(self::namespace1)
            ->withDescription(null)
            ->withType('gs2')
            ->withGcpCredentialJson('{"project": "test"}')
            ->withBigQueryDatasetName('dataset-0001')
            ->withLogExpireDays(3)
            ->withAwsRegion('awsRegion')
            ->withAwsAccessKeyId('awsAccessKeyId')
            ->withAwsSecretAccessKey('awsSecretAccessKey')
            ->withFirehoseStreamName('firehoseStreamName')
    );
    $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("namespace1")
            .withDescription(null)
            .withType("gs2")
            .withGcpCredentialJson("{\"project\": \"test\"}")
            .withBigQueryDatasetName("dataset-0001")
            .withLogExpireDays(3)
            .withAwsRegion("awsRegion")
            .withAwsAccessKeyId("awsAccessKeyId")
            .withAwsSecretAccessKey("awsSecretAccessKey")
            .withFirehoseStreamName("firehoseStreamName")
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Log.Gs2LogRestClient;
using Gs2.Gs2Log.Request.CreateNamespaceRequest;
using Gs2.Gs2Log.Result.CreateNamespaceResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LogRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.createNamespace(
    new CreateNamespaceRequest()
        .withName("namespace1")
        .withDescription(null)
        .withType("gs2")
        .withGcpCredentialJson("{\"project\": \"test\"}")
        .withBigQueryDatasetName("dataset-0001")
        .withLogExpireDays(3)
        .withAwsRegion("awsRegion")
        .withAwsAccessKeyId("awsAccessKeyId")
        .withAwsSecretAccessKey("awsSecretAccessKey")
        .withFirehoseStreamName("firehoseStreamName"),
    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('namespace1')
            .withDescription(undefined)
            .withType('gs2')
            .withGcpCredentialJson('{"project": "test"}')
            .withBigQueryDatasetName('dataset-0001')
            .withLogExpireDays(3)
            .withAwsRegion('awsRegion')
            .withAwsAccessKeyId('awsAccessKeyId')
            .withAwsSecretAccessKey('awsSecretAccessKey')
            .withFirehoseStreamName('firehoseStreamName')
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import log

const session = new core.Gs2RestSession(
    "ap-northeast-1",
    new core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
)
await session.connect()
client = new log.Gs2LogRestClient(session)

try:
    result = client.create_namespace(
        new log.CreateNamespaceRequest()
            .with_name(self.hash1)
            .with_description(None)
            .with_type('gs2')
            .with_gcp_credential_json('{"project": "test"}')
            .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')
    )
    item = result.item
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('log')

api_result = client.create_namespace({
    name='namespace1',
    description=nil,
    type='gs2',
    gcpCredentialJson='{"project": "test"}',
    bigQueryDatasetName='dataset-0001',
    logExpireDays=3,
    awsRegion='awsRegion',
    awsAccessKeyId='awsAccessKeyId',
    awsSecretAccessKey='awsSecretAccessKey',
    firehoseStreamName='firehoseStreamName',
});

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

ネームスペースを新規作成

Request

必須 デフォルト 値の制限 説明
name string ~ 32文字 ネームスペース名
description string ~ 1024文字 説明文
type string "gs2" ~ 128文字 ログの書き出し方法
gcpCredentialJson string {type} == "bigquery" ~ 5120文字 GCPのクレデンシャル
bigQueryDatasetName string {type} == "bigquery" ~ 256文字 BigQueryのデータセット名
logExpireDays int {type} in ["gs2", "bigquery"] ~ 3650 ログの保存期間(日)
awsRegion string {type} == "firehose" ~ 256文字 AWSのリージョン
awsAccessKeyId string {type} == "firehose" ~ 256文字 AWSのアクセスキーID
awsSecretAccessKey string {type} == "firehose" ~ 256文字 AWSのシークレットアクセスキー
firehoseStreamName string {type} == "firehose" ~ 256文字 Kinesis Firehose のストリーム名

Result

説明
item Namespace 作成したネームスペース

getNamespaceStatus

getNamespaceStatus

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("namespace1"),
    }
)
if err != nil {
    panic("error occurred")
}
status := result.Status
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\GetNamespaceStatusRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getNamespaceStatus(
        (new GetNamespaceStatusRequest())
            ->withNamespaceName(self::namespace1)
    );
    $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("namespace1")
    );
    String status = result.getStatus();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Log.Gs2LogRestClient;
using Gs2.Gs2Log.Request.GetNamespaceStatusRequest;
using Gs2.Gs2Log.Result.GetNamespaceStatusResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LogRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getNamespaceStatus(
    new GetNamespaceStatusRequest()
        .withNamespaceName("namespace1"),
    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('namespace1')
    );
    const status = result.getStatus();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import log

const session = new core.Gs2RestSession(
    "ap-northeast-1",
    new core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
)
await session.connect()
client = new log.Gs2LogRestClient(session)

try:
    result = client.get_namespace_status(
        new log.GetNamespaceStatusRequest()
            .with_namespace_name(self.hash1)
    )
    status = result.status
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('log')

api_result = client.get_namespace_status({
    namespaceName='namespace1',
});

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
status = result.status;

ネームスペースの状態を取得

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名

Result

説明
status string

getNamespace

getNamespace

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("namespace1"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\GetNamespaceRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getNamespace(
        (new GetNamespaceRequest())
            ->withNamespaceName(self::namespace1)
    );
    $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("namespace1")
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Log.Gs2LogRestClient;
using Gs2.Gs2Log.Request.GetNamespaceRequest;
using Gs2.Gs2Log.Result.GetNamespaceResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LogRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getNamespace(
    new GetNamespaceRequest()
        .withNamespaceName("namespace1"),
    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('namespace1')
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import log

const session = new core.Gs2RestSession(
    "ap-northeast-1",
    new core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
)
await session.connect()
client = new log.Gs2LogRestClient(session)

try:
    result = client.get_namespace(
        new log.GetNamespaceRequest()
            .with_namespace_name(self.hash1)
    )
    item = result.item
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('log')

api_result = client.get_namespace({
    namespaceName='namespace1',
});

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

ネームスペースを取得

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名

Result

説明
item Namespace ネームスペース

updateNamespace

updateNamespace

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("namespace1"),
        Description: pointy.String("description1"),
        Type: pointy.String("firehose"),
        GcpCredentialJson: pointy.String("{\"project\": \"test\"}"),
        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"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\UpdateNamespaceRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateNamespace(
        (new UpdateNamespaceRequest())
            ->withNamespaceName(self::namespace1)
            ->withDescription('description1')
            ->withType('firehose')
            ->withGcpCredentialJson('{"project": "test"}')
            ->withBigQueryDatasetName('dataset-0001')
            ->withLogExpireDays(3)
            ->withAwsRegion('awsRegion')
            ->withAwsAccessKeyId('awsAccessKeyId')
            ->withAwsSecretAccessKey('awsSecretAccessKey')
            ->withFirehoseStreamName('firehoseStreamName')
    );
    $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("namespace1")
            .withDescription("description1")
            .withType("firehose")
            .withGcpCredentialJson("{\"project\": \"test\"}")
            .withBigQueryDatasetName("dataset-0001")
            .withLogExpireDays(3)
            .withAwsRegion("awsRegion")
            .withAwsAccessKeyId("awsAccessKeyId")
            .withAwsSecretAccessKey("awsSecretAccessKey")
            .withFirehoseStreamName("firehoseStreamName")
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Log.Gs2LogRestClient;
using Gs2.Gs2Log.Request.UpdateNamespaceRequest;
using Gs2.Gs2Log.Result.UpdateNamespaceResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LogRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.updateNamespace(
    new UpdateNamespaceRequest()
        .withNamespaceName("namespace1")
        .withDescription("description1")
        .withType("firehose")
        .withGcpCredentialJson("{\"project\": \"test\"}")
        .withBigQueryDatasetName("dataset-0001")
        .withLogExpireDays(3)
        .withAwsRegion("awsRegion")
        .withAwsAccessKeyId("awsAccessKeyId")
        .withAwsSecretAccessKey("awsSecretAccessKey")
        .withFirehoseStreamName("firehoseStreamName"),
    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('namespace1')
            .withDescription('description1')
            .withType('firehose')
            .withGcpCredentialJson('{"project": "test"}')
            .withBigQueryDatasetName('dataset-0001')
            .withLogExpireDays(3)
            .withAwsRegion('awsRegion')
            .withAwsAccessKeyId('awsAccessKeyId')
            .withAwsSecretAccessKey('awsSecretAccessKey')
            .withFirehoseStreamName('firehoseStreamName')
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import log

const session = new core.Gs2RestSession(
    "ap-northeast-1",
    new core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
)
await session.connect()
client = new log.Gs2LogRestClient(session)

try:
    result = client.update_namespace(
        new log.UpdateNamespaceRequest()
            .with_namespace_name(self.hash1)
            .with_description('description1')
            .with_type('firehose')
            .with_gcp_credential_json('{"project": "test"}')
            .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')
    )
    item = result.item
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('log')

api_result = client.update_namespace({
    namespaceName='namespace1',
    description='description1',
    type='firehose',
    gcpCredentialJson='{"project": "test"}',
    bigQueryDatasetName='dataset-0001',
    logExpireDays=3,
    awsRegion='awsRegion',
    awsAccessKeyId='awsAccessKeyId',
    awsSecretAccessKey='awsSecretAccessKey',
    firehoseStreamName='firehoseStreamName',
});

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

ネームスペースを更新

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
description string ~ 1024文字 説明文
type string "gs2" ~ 128文字 ログの書き出し方法
gcpCredentialJson string {type} == "bigquery" ~ 5120文字 GCPのクレデンシャル
bigQueryDatasetName string {type} == "bigquery" ~ 256文字 BigQueryのデータセット名
logExpireDays int {type} in ["gs2", "bigquery"] ~ 3650 ログの保存期間(日)
awsRegion string {type} == "firehose" ~ 256文字 AWSのリージョン
awsAccessKeyId string {type} == "firehose" ~ 256文字 AWSのアクセスキーID
awsSecretAccessKey string {type} == "firehose" ~ 256文字 AWSのシークレットアクセスキー
firehoseStreamName string {type} == "firehose" ~ 256文字 Kinesis Firehose のストリーム名

Result

説明
item Namespace 更新したネームスペース

deleteNamespace

deleteNamespace

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("namespace1"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\DeleteNamespaceRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteNamespace(
        (new DeleteNamespaceRequest())
            ->withNamespaceName(self::namespace1)
    );
    $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("namespace1")
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Log.Gs2LogRestClient;
using Gs2.Gs2Log.Request.DeleteNamespaceRequest;
using Gs2.Gs2Log.Result.DeleteNamespaceResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LogRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.deleteNamespace(
    new DeleteNamespaceRequest()
        .withNamespaceName("namespace1"),
    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('namespace1')
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import log

const session = new core.Gs2RestSession(
    "ap-northeast-1",
    new core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
)
await session.connect()
client = new log.Gs2LogRestClient(session)

try:
    result = client.delete_namespace(
        new log.DeleteNamespaceRequest()
            .with_namespace_name(self.hash1)
    )
    item = result.item
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('log')

api_result = client.delete_namespace({
    namespaceName='namespace1',
});

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

ネームスペースを削除

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名

Result

説明
item Namespace 削除したネームスペース

queryAccessLog

queryAccessLog

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("namespace1"),
        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,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
totalCount := result.TotalCount
scanSize := result.ScanSize
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\QueryAccessLogRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->queryAccessLog(
        (new QueryAccessLogRequest())
            ->withNamespaceName(self::namespace1)
            ->withService('account')
            ->withMethod('createAccount')
            ->withUserId('user-0001')
            ->withBegin(1473174000000)
            ->withEnd(1473177600000)
            ->withLongTerm(False)
            ->withPageToken(null)
            ->withLimit(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("namespace1")
            .withService("account")
            .withMethod("createAccount")
            .withUserId("user-0001")
            .withBegin(1473174000000L)
            .withEnd(1473177600000L)
            .withLongTerm(false)
            .withPageToken(null)
            .withLimit(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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Log.Gs2LogRestClient;
using Gs2.Gs2Log.Request.QueryAccessLogRequest;
using Gs2.Gs2Log.Result.QueryAccessLogResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LogRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.queryAccessLog(
    new QueryAccessLogRequest()
        .withNamespaceName("namespace1")
        .withService("account")
        .withMethod("createAccount")
        .withUserId("user-0001")
        .withBegin(1473174000000L)
        .withEnd(1473177600000L)
        .withLongTerm(false)
        .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;
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('namespace1')
            .withService('account')
            .withMethod('createAccount')
            .withUserId('user-0001')
            .withBegin(1473174000000)
            .withEnd(1473177600000)
            .withLongTerm(false)
            .withPageToken(undefined)
            .withLimit(undefined)
    );
    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

const session = new core.Gs2RestSession(
    "ap-northeast-1",
    new core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
)
await session.connect()
client = new log.Gs2LogRestClient(session)

try:
    result = client.query_access_log(
        new log.QueryAccessLogRequest()
            .with_namespace_name(self.hash1)
            .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)
    )
    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:
    os.exit(1);

client = gs2('log')

api_result = client.query_access_log({
    namespaceName='namespace1',
    service='account',
    method='createAccount',
    userId='user-0001',
    begin=1473174000000,
    end=1473177600000,
    longTerm=false,
    pageToken=nil,
    limit=nil,
});

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
totalCount = result.totalCount;
scanSize = result.scanSize;

アクセスログの一覧を取得

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
service string ~ 1024文字 マイクロサービスの種類
method string ~ 1024文字 マイクロサービスのメソッド
userId string ~ 128文字 ユーザーID
begin long 現在時刻からのオフセット(-1時間) 検索範囲開始日時
end long 現在時刻 検索範囲終了日時
longTerm bool false 7日より長い期間のログを検索対象とするか
pageToken string ~ 1024文字 データの取得を開始する位置を指定するトークン
limit int 30 1 ~ 1000 データの取得件数

Result

説明
items AccessLog[] アクセスログのリスト
nextPageToken string リストの続きを取得するためのページトークン
totalCount long クエリ結果の総件数
scanSize long 検索時にスキャンした総容量

countAccessLog

countAccessLog

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("namespace1"),
        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,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
totalCount := result.TotalCount
scanSize := result.ScanSize
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\CountAccessLogRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->countAccessLog(
        (new CountAccessLogRequest())
            ->withNamespaceName(self::namespace1)
            ->withService('account')
            ->withMethod('createAccount')
            ->withUserId('user-0001')
            ->withBegin(1473174000000)
            ->withEnd(1473177600000)
            ->withLongTerm(False)
            ->withPageToken(null)
            ->withLimit(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("namespace1")
            .withService("account")
            .withMethod("createAccount")
            .withUserId("user-0001")
            .withBegin(1473174000000L)
            .withEnd(1473177600000L)
            .withLongTerm(false)
            .withPageToken(null)
            .withLimit(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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Log.Gs2LogRestClient;
using Gs2.Gs2Log.Request.CountAccessLogRequest;
using Gs2.Gs2Log.Result.CountAccessLogResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LogRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.countAccessLog(
    new CountAccessLogRequest()
        .withNamespaceName("namespace1")
        .withService("account")
        .withMethod("createAccount")
        .withUserId("user-0001")
        .withBegin(1473174000000L)
        .withEnd(1473177600000L)
        .withLongTerm(false)
        .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;
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('namespace1')
            .withService('account')
            .withMethod('createAccount')
            .withUserId('user-0001')
            .withBegin(1473174000000)
            .withEnd(1473177600000)
            .withLongTerm(false)
            .withPageToken(undefined)
            .withLimit(undefined)
    );
    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

const session = new core.Gs2RestSession(
    "ap-northeast-1",
    new core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
)
await session.connect()
client = new log.Gs2LogRestClient(session)

try:
    result = client.count_access_log(
        new log.CountAccessLogRequest()
            .with_namespace_name(self.hash1)
            .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)
    )
    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:
    os.exit(1);

client = gs2('log')

api_result = client.count_access_log({
    namespaceName='namespace1',
    service='account',
    method='createAccount',
    userId='user-0001',
    begin=1473174000000,
    end=1473177600000,
    longTerm=false,
    pageToken=nil,
    limit=nil,
});

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
totalCount = result.totalCount;
scanSize = result.scanSize;

アクセスログの一覧を取得

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
service string ~ 1024文字 マイクロサービスの種類
method string ~ 1024文字 マイクロサービスのメソッド
userId string ~ 128文字 ユーザーID
begin long 現在時刻からのオフセット(-1時間) 検索範囲開始日時
end long 現在時刻 検索範囲終了日時
longTerm bool false 7日より長い期間のログを検索対象とするか
pageToken string ~ 1024文字 データの取得を開始する位置を指定するトークン
limit int 30 1 ~ 1000 データの取得件数

Result

説明
items AccessLogCount[] アクセスログ集計のリスト
nextPageToken string リストの続きを取得するためのページトークン
totalCount long クエリ結果の総件数
scanSize long 検索時にスキャンした総容量

queryIssueStampSheetLog

queryIssueStampSheetLog

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("namespace1"),
        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,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
totalCount := result.TotalCount
scanSize := result.ScanSize
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\QueryIssueStampSheetLogRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->queryIssueStampSheetLog(
        (new QueryIssueStampSheetLogRequest())
            ->withNamespaceName(self::namespace1)
            ->withService('showcase')
            ->withMethod('buy')
            ->withUserId('user-0001')
            ->withAction('Gs2Showcase:Buy')
            ->withBegin(1473174000000)
            ->withEnd(1473177600000)
            ->withLongTerm(False)
            ->withPageToken(null)
            ->withLimit(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("namespace1")
            .withService("showcase")
            .withMethod("buy")
            .withUserId("user-0001")
            .withAction("Gs2Showcase:Buy")
            .withBegin(1473174000000L)
            .withEnd(1473177600000L)
            .withLongTerm(false)
            .withPageToken(null)
            .withLimit(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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Log.Gs2LogRestClient;
using Gs2.Gs2Log.Request.QueryIssueStampSheetLogRequest;
using Gs2.Gs2Log.Result.QueryIssueStampSheetLogResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LogRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.queryIssueStampSheetLog(
    new QueryIssueStampSheetLogRequest()
        .withNamespaceName("namespace1")
        .withService("showcase")
        .withMethod("buy")
        .withUserId("user-0001")
        .withAction("Gs2Showcase:Buy")
        .withBegin(1473174000000L)
        .withEnd(1473177600000L)
        .withLongTerm(false)
        .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;
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('namespace1')
            .withService('showcase')
            .withMethod('buy')
            .withUserId('user-0001')
            .withAction('Gs2Showcase:Buy')
            .withBegin(1473174000000)
            .withEnd(1473177600000)
            .withLongTerm(false)
            .withPageToken(undefined)
            .withLimit(undefined)
    );
    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

const session = new core.Gs2RestSession(
    "ap-northeast-1",
    new core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
)
await session.connect()
client = new log.Gs2LogRestClient(session)

try:
    result = client.query_issue_stamp_sheet_log(
        new log.QueryIssueStampSheetLogRequest()
            .with_namespace_name(self.hash1)
            .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)
    )
    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:
    os.exit(1);

client = gs2('log')

api_result = client.query_issue_stamp_sheet_log({
    namespaceName='namespace1',
    service='showcase',
    method='buy',
    userId='user-0001',
    action='Gs2Showcase:Buy',
    begin=1473174000000,
    end=1473177600000,
    longTerm=false,
    pageToken=nil,
    limit=nil,
});

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
totalCount = result.totalCount;
scanSize = result.scanSize;

スタンプシート発行ログの一覧を取得

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
service string ~ 1024文字 マイクロサービスの種類
method string ~ 1024文字 マイクロサービスのメソッド
userId string ~ 128文字 ユーザーID
action string ~ 1024文字 報酬アクション
begin long 現在時刻からのオフセット(-1時間) 検索範囲開始日時
end long 現在時刻 検索範囲終了日時
longTerm bool false 7日より長い期間のログを検索対象とするか
pageToken string ~ 1024文字 データの取得を開始する位置を指定するトークン
limit int 30 1 ~ 1000 データの取得件数

Result

説明
items IssueStampSheetLog[] スタンプシート発行ログのリスト
nextPageToken string リストの続きを取得するためのページトークン
totalCount long クエリ結果の総件数
scanSize long 検索時にスキャンした総容量

countIssueStampSheetLog

countIssueStampSheetLog

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("namespace1"),
        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,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
totalCount := result.TotalCount
scanSize := result.ScanSize
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\CountIssueStampSheetLogRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->countIssueStampSheetLog(
        (new CountIssueStampSheetLogRequest())
            ->withNamespaceName(self::namespace1)
            ->withService('showcase')
            ->withMethod('buy')
            ->withUserId('user-0001')
            ->withAction('Gs2Showcase:Buy')
            ->withBegin(1473174000000)
            ->withEnd(1473177600000)
            ->withLongTerm(False)
            ->withPageToken(null)
            ->withLimit(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("namespace1")
            .withService("showcase")
            .withMethod("buy")
            .withUserId("user-0001")
            .withAction("Gs2Showcase:Buy")
            .withBegin(1473174000000L)
            .withEnd(1473177600000L)
            .withLongTerm(false)
            .withPageToken(null)
            .withLimit(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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Log.Gs2LogRestClient;
using Gs2.Gs2Log.Request.CountIssueStampSheetLogRequest;
using Gs2.Gs2Log.Result.CountIssueStampSheetLogResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LogRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.countIssueStampSheetLog(
    new CountIssueStampSheetLogRequest()
        .withNamespaceName("namespace1")
        .withService("showcase")
        .withMethod("buy")
        .withUserId("user-0001")
        .withAction("Gs2Showcase:Buy")
        .withBegin(1473174000000L)
        .withEnd(1473177600000L)
        .withLongTerm(false)
        .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;
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('namespace1')
            .withService('showcase')
            .withMethod('buy')
            .withUserId('user-0001')
            .withAction('Gs2Showcase:Buy')
            .withBegin(1473174000000)
            .withEnd(1473177600000)
            .withLongTerm(false)
            .withPageToken(undefined)
            .withLimit(undefined)
    );
    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

const session = new core.Gs2RestSession(
    "ap-northeast-1",
    new core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
)
await session.connect()
client = new log.Gs2LogRestClient(session)

try:
    result = client.count_issue_stamp_sheet_log(
        new log.CountIssueStampSheetLogRequest()
            .with_namespace_name(self.hash1)
            .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)
    )
    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:
    os.exit(1);

client = gs2('log')

api_result = client.count_issue_stamp_sheet_log({
    namespaceName='namespace1',
    service='showcase',
    method='buy',
    userId='user-0001',
    action='Gs2Showcase:Buy',
    begin=1473174000000,
    end=1473177600000,
    longTerm=false,
    pageToken=nil,
    limit=nil,
});

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
totalCount = result.totalCount;
scanSize = result.scanSize;

スタンプシート発行ログの一覧を取得

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
service string ~ 1024文字 マイクロサービスの種類
method string ~ 1024文字 マイクロサービスのメソッド
userId string ~ 128文字 ユーザーID
action string ~ 1024文字 報酬アクション
begin long 現在時刻からのオフセット(-1時間) 検索範囲開始日時
end long 現在時刻 検索範囲終了日時
longTerm bool false 7日より長い期間のログを検索対象とするか
pageToken string ~ 1024文字 データの取得を開始する位置を指定するトークン
limit int 30 1 ~ 1000 データの取得件数

Result

説明
items IssueStampSheetLogCount[] スタンプシート発行ログ集計のリスト
nextPageToken string リストの続きを取得するためのページトークン
totalCount long クエリ結果の総件数
scanSize long 検索時にスキャンした総容量

queryExecuteStampSheetLog

queryExecuteStampSheetLog

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("namespace1"),
        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,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
totalCount := result.TotalCount
scanSize := result.ScanSize
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\QueryExecuteStampSheetLogRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->queryExecuteStampSheetLog(
        (new QueryExecuteStampSheetLogRequest())
            ->withNamespaceName(self::namespace1)
            ->withService('inventory')
            ->withMethod('acquireItemSetByUserId')
            ->withUserId('user-0001')
            ->withAction(null)
            ->withBegin(1473174000000)
            ->withEnd(1473177600000)
            ->withLongTerm(False)
            ->withPageToken(null)
            ->withLimit(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("namespace1")
            .withService("inventory")
            .withMethod("acquireItemSetByUserId")
            .withUserId("user-0001")
            .withAction(null)
            .withBegin(1473174000000L)
            .withEnd(1473177600000L)
            .withLongTerm(false)
            .withPageToken(null)
            .withLimit(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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Log.Gs2LogRestClient;
using Gs2.Gs2Log.Request.QueryExecuteStampSheetLogRequest;
using Gs2.Gs2Log.Result.QueryExecuteStampSheetLogResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LogRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.queryExecuteStampSheetLog(
    new QueryExecuteStampSheetLogRequest()
        .withNamespaceName("namespace1")
        .withService("inventory")
        .withMethod("acquireItemSetByUserId")
        .withUserId("user-0001")
        .withAction(null)
        .withBegin(1473174000000L)
        .withEnd(1473177600000L)
        .withLongTerm(false)
        .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;
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('namespace1')
            .withService('inventory')
            .withMethod('acquireItemSetByUserId')
            .withUserId('user-0001')
            .withAction(undefined)
            .withBegin(1473174000000)
            .withEnd(1473177600000)
            .withLongTerm(false)
            .withPageToken(undefined)
            .withLimit(undefined)
    );
    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

const session = new core.Gs2RestSession(
    "ap-northeast-1",
    new core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
)
await session.connect()
client = new log.Gs2LogRestClient(session)

try:
    result = client.query_execute_stamp_sheet_log(
        new log.QueryExecuteStampSheetLogRequest()
            .with_namespace_name(self.hash1)
            .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)
    )
    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:
    os.exit(1);

client = gs2('log')

api_result = client.query_execute_stamp_sheet_log({
    namespaceName='namespace1',
    service='inventory',
    method='acquireItemSetByUserId',
    userId='user-0001',
    action=nil,
    begin=1473174000000,
    end=1473177600000,
    longTerm=false,
    pageToken=nil,
    limit=nil,
});

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
totalCount = result.totalCount;
scanSize = result.scanSize;

スタンプシート実行ログの一覧を取得

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
service string ~ 1024文字 マイクロサービスの種類
method string ~ 1024文字 マイクロサービスのメソッド
userId string ~ 128文字 ユーザーID
action string ~ 1024文字 報酬アクション
begin long 現在時刻からのオフセット(-1時間) 検索範囲開始日時
end long 現在時刻 検索範囲終了日時
longTerm bool false 7日より長い期間のログを検索対象とするか
pageToken string ~ 1024文字 データの取得を開始する位置を指定するトークン
limit int 30 1 ~ 1000 データの取得件数

Result

説明
items ExecuteStampSheetLog[] スタンプシート実行ログのリスト
nextPageToken string リストの続きを取得するためのページトークン
totalCount long クエリ結果の総件数
scanSize long 検索時にスキャンした総容量

countExecuteStampSheetLog

countExecuteStampSheetLog

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("namespace1"),
        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,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
totalCount := result.TotalCount
scanSize := result.ScanSize
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\CountExecuteStampSheetLogRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->countExecuteStampSheetLog(
        (new CountExecuteStampSheetLogRequest())
            ->withNamespaceName(self::namespace1)
            ->withService('inventory')
            ->withMethod('acquireItemSetByUserId')
            ->withUserId('user-0001')
            ->withAction(null)
            ->withBegin(1473174000000)
            ->withEnd(1473177600000)
            ->withLongTerm(False)
            ->withPageToken(null)
            ->withLimit(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("namespace1")
            .withService("inventory")
            .withMethod("acquireItemSetByUserId")
            .withUserId("user-0001")
            .withAction(null)
            .withBegin(1473174000000L)
            .withEnd(1473177600000L)
            .withLongTerm(false)
            .withPageToken(null)
            .withLimit(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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Log.Gs2LogRestClient;
using Gs2.Gs2Log.Request.CountExecuteStampSheetLogRequest;
using Gs2.Gs2Log.Result.CountExecuteStampSheetLogResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LogRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.countExecuteStampSheetLog(
    new CountExecuteStampSheetLogRequest()
        .withNamespaceName("namespace1")
        .withService("inventory")
        .withMethod("acquireItemSetByUserId")
        .withUserId("user-0001")
        .withAction(null)
        .withBegin(1473174000000L)
        .withEnd(1473177600000L)
        .withLongTerm(false)
        .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;
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('namespace1')
            .withService('inventory')
            .withMethod('acquireItemSetByUserId')
            .withUserId('user-0001')
            .withAction(undefined)
            .withBegin(1473174000000)
            .withEnd(1473177600000)
            .withLongTerm(false)
            .withPageToken(undefined)
            .withLimit(undefined)
    );
    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

const session = new core.Gs2RestSession(
    "ap-northeast-1",
    new core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
)
await session.connect()
client = new log.Gs2LogRestClient(session)

try:
    result = client.count_execute_stamp_sheet_log(
        new log.CountExecuteStampSheetLogRequest()
            .with_namespace_name(self.hash1)
            .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)
    )
    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:
    os.exit(1);

client = gs2('log')

api_result = client.count_execute_stamp_sheet_log({
    namespaceName='namespace1',
    service='inventory',
    method='acquireItemSetByUserId',
    userId='user-0001',
    action=nil,
    begin=1473174000000,
    end=1473177600000,
    longTerm=false,
    pageToken=nil,
    limit=nil,
});

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
totalCount = result.totalCount;
scanSize = result.scanSize;

スタンプシート実行ログの一覧を取得

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
service string ~ 1024文字 マイクロサービスの種類
method string ~ 1024文字 マイクロサービスのメソッド
userId string ~ 128文字 ユーザーID
action string ~ 1024文字 報酬アクション
begin long 現在時刻からのオフセット(-1時間) 検索範囲開始日時
end long 現在時刻 検索範囲終了日時
longTerm bool false 7日より長い期間のログを検索対象とするか
pageToken string ~ 1024文字 データの取得を開始する位置を指定するトークン
limit int 30 1 ~ 1000 データの取得件数

Result

説明
items ExecuteStampSheetLogCount[] スタンプシート実行ログ集計のリスト
nextPageToken string リストの続きを取得するためのページトークン
totalCount long クエリ結果の総件数
scanSize long 検索時にスキャンした総容量

queryExecuteStampTaskLog

queryExecuteStampTaskLog

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("namespace1"),
        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,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
totalCount := result.TotalCount
scanSize := result.ScanSize
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\QueryExecuteStampTaskLogRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->queryExecuteStampTaskLog(
        (new QueryExecuteStampTaskLogRequest())
            ->withNamespaceName(self::namespace1)
            ->withService('inventory')
            ->withMethod('consumeItemSetByUserId')
            ->withUserId('user-0001')
            ->withAction(null)
            ->withBegin(1473174000000)
            ->withEnd(1473177600000)
            ->withLongTerm(False)
            ->withPageToken(null)
            ->withLimit(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("namespace1")
            .withService("inventory")
            .withMethod("consumeItemSetByUserId")
            .withUserId("user-0001")
            .withAction(null)
            .withBegin(1473174000000L)
            .withEnd(1473177600000L)
            .withLongTerm(false)
            .withPageToken(null)
            .withLimit(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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Log.Gs2LogRestClient;
using Gs2.Gs2Log.Request.QueryExecuteStampTaskLogRequest;
using Gs2.Gs2Log.Result.QueryExecuteStampTaskLogResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LogRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.queryExecuteStampTaskLog(
    new QueryExecuteStampTaskLogRequest()
        .withNamespaceName("namespace1")
        .withService("inventory")
        .withMethod("consumeItemSetByUserId")
        .withUserId("user-0001")
        .withAction(null)
        .withBegin(1473174000000L)
        .withEnd(1473177600000L)
        .withLongTerm(false)
        .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;
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('namespace1')
            .withService('inventory')
            .withMethod('consumeItemSetByUserId')
            .withUserId('user-0001')
            .withAction(undefined)
            .withBegin(1473174000000)
            .withEnd(1473177600000)
            .withLongTerm(false)
            .withPageToken(undefined)
            .withLimit(undefined)
    );
    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

const session = new core.Gs2RestSession(
    "ap-northeast-1",
    new core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
)
await session.connect()
client = new log.Gs2LogRestClient(session)

try:
    result = client.query_execute_stamp_task_log(
        new log.QueryExecuteStampTaskLogRequest()
            .with_namespace_name(self.hash1)
            .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)
    )
    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:
    os.exit(1);

client = gs2('log')

api_result = client.query_execute_stamp_task_log({
    namespaceName='namespace1',
    service='inventory',
    method='consumeItemSetByUserId',
    userId='user-0001',
    action=nil,
    begin=1473174000000,
    end=1473177600000,
    longTerm=false,
    pageToken=nil,
    limit=nil,
});

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
totalCount = result.totalCount;
scanSize = result.scanSize;

スタンプタスク実行ログの一覧を取得

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
service string ~ 1024文字 マイクロサービスの種類
method string ~ 1024文字 マイクロサービスのメソッド
userId string ~ 128文字 ユーザーID
action string ~ 1024文字 報酬アクション
begin long 現在時刻からのオフセット(-1時間) 検索範囲開始日時
end long 現在時刻 検索範囲終了日時
longTerm bool false 7日より長い期間のログを検索対象とするか
pageToken string ~ 1024文字 データの取得を開始する位置を指定するトークン
limit int 30 1 ~ 1000 データの取得件数

Result

説明
items ExecuteStampTaskLog[] スタンプタスク実行ログのリスト
nextPageToken string リストの続きを取得するためのページトークン
totalCount long クエリ結果の総件数
scanSize long 検索時にスキャンした総容量

countExecuteStampTaskLog

countExecuteStampTaskLog

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("namespace1"),
        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,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
totalCount := result.TotalCount
scanSize := result.ScanSize
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Log\Gs2LogRestClient;
use Gs2\Log\Request\CountExecuteStampTaskLogRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->countExecuteStampTaskLog(
        (new CountExecuteStampTaskLogRequest())
            ->withNamespaceName(self::namespace1)
            ->withService('inventory')
            ->withMethod('consumeItemSetByUserId')
            ->withUserId('user-0001')
            ->withAction(null)
            ->withBegin(1473174000000)
            ->withEnd(1473177600000)
            ->withLongTerm(False)
            ->withPageToken(null)
            ->withLimit(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("namespace1")
            .withService("inventory")
            .withMethod("consumeItemSetByUserId")
            .withUserId("user-0001")
            .withAction(null)
            .withBegin(1473174000000L)
            .withEnd(1473177600000L)
            .withLongTerm(false)
            .withPageToken(null)
            .withLimit(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.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Log.Gs2LogRestClient;
using Gs2.Gs2Log.Request.CountExecuteStampTaskLogRequest;
using Gs2.Gs2Log.Result.CountExecuteStampTaskLogResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LogRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.countExecuteStampTaskLog(
    new CountExecuteStampTaskLogRequest()
        .withNamespaceName("namespace1")
        .withService("inventory")
        .withMethod("consumeItemSetByUserId")
        .withUserId("user-0001")
        .withAction(null)
        .withBegin(1473174000000L)
        .withEnd(1473177600000L)
        .withLongTerm(false)
        .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;
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('namespace1')
            .withService('inventory')
            .withMethod('consumeItemSetByUserId')
            .withUserId('user-0001')
            .withAction(undefined)
            .withBegin(1473174000000)
            .withEnd(1473177600000)
            .withLongTerm(false)
            .withPageToken(undefined)
            .withLimit(undefined)
    );
    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

const session = new core.Gs2RestSession(
    "ap-northeast-1",
    new core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
)
await session.connect()
client = new log.Gs2LogRestClient(session)

try:
    result = client.count_execute_stamp_task_log(
        new log.CountExecuteStampTaskLogRequest()
            .with_namespace_name(self.hash1)
            .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)
    )
    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:
    os.exit(1);

client = gs2('log')

api_result = client.count_execute_stamp_task_log({
    namespaceName='namespace1',
    service='inventory',
    method='consumeItemSetByUserId',
    userId='user-0001',
    action=nil,
    begin=1473174000000,
    end=1473177600000,
    longTerm=false,
    pageToken=nil,
    limit=nil,
});

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
totalCount = result.totalCount;
scanSize = result.scanSize;

スタンプタスク実行ログの一覧を取得

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
service string ~ 1024文字 マイクロサービスの種類
method string ~ 1024文字 マイクロサービスのメソッド
userId string ~ 128文字 ユーザーID
action string ~ 1024文字 報酬アクション
begin long 現在時刻からのオフセット(-1時間) 検索範囲開始日時
end long 現在時刻 検索範囲終了日時
longTerm bool false 7日より長い期間のログを検索対象とするか
pageToken string ~ 1024文字 データの取得を開始する位置を指定するトークン
limit int 30 1 ~ 1000 データの取得件数

Result

説明
items ExecuteStampTaskLogCount[] スタンプタスク実行ログ集計のリスト
nextPageToken string リストの続きを取得するためのページトークン
totalCount long クエリ結果の総件数
scanSize long 検索時にスキャンした総容量