NAV
go python java php typescript csharp GS2-Script

GS2-Key

GS2-SDK のリファレンス

モデル

Namespace

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

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

説明
namespaceId string ネームスペースGRN
name string ネームスペース名
description string 説明文
logSetting LogSetting ログの出力設定
createdAt long 作成日時
updatedAt long 最終更新日時

Key

暗号鍵を表すエンティティです。

GS2 で暗号化処理が必要な場合にここで作成する暗号鍵のGRNを指定する必要があります。 具体的な暗号鍵の内容は GS2 の外に出ることはなく、安全に暗号化・復号処理を行えます。

説明
keyId string 暗号鍵GRN
name string 暗号鍵名
description string 説明文
createdAt long 作成日時
updatedAt long 最終更新日時

GitHubApiKey

GitHub にアクセスするためのAPIキーを格納するエンティティです。

GS2 ではマスターデータや GS2-Deploy のテンプレートファイルなどファイルをアップロードするインターフェースが複数あります。 このようなインターフェースに対して、データをアップロードするのではなく、GitHunの特定のリポジトリの特定のブランチやタグから設定を反映するインターフェースが用意されています。

このインターフェースを利用するにあたって必要となる GitHub の APIキー を格納します。

説明
apiKeyId string GitHub のAPIキーGRN
name string GitHub APIキー名
description string 説明文
encryptionKeyName string APIキーの暗号化に使用する暗号鍵名
createdAt long 作成日時
updatedAt long 最終更新日時

LogSetting

説明
loggingNamespaceId string ネームスペースGRN

メソッド

describeNamespaces

describeNamespaces

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/key"
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 := key.Gs2KeyRestClient{
    Session: &session,
}
result, err := client.DescribeNamespaces(
    &key.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\Key\Gs2KeyRestClient;
use Gs2\Key\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.key.rest.Gs2KeyRestClient;
import io.gs2.key.request.DescribeNamespacesRequest;
import io.gs2.key.result.DescribeNamespacesResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2KeyRestClient client = new Gs2KeyRestClient(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.Gs2Key.Gs2KeyRestClient;
using Gs2.Gs2Key.Request.DescribeNamespacesRequest;
using Gs2.Gs2Key.Result.DescribeNamespacesResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2KeyRestClient(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 Gs2Key from '@/gs2/key';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Key.Gs2KeyRestClient(session);

try {
    const result = await client.describeNamespaces(
        new Gs2Key.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 key

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

try:
    result = client.describe_namespaces(
        new key.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('key')

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/key"
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 := key.Gs2KeyRestClient{
    Session: &session,
}
result, err := client.CreateNamespace(
    &key.CreateNamespaceRequest {
        Name: pointy.String("namespace1"),
        Description: nil,
        LogSetting: &key.LogSetting{
            LoggingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:log: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\Key\Gs2KeyRestClient;
use Gs2\Key\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)
            ->withLogSetting((new \Gs2\Key\Model\LogSetting())
                ->withLoggingNamespaceId('grn:gs2:ap-northeast-1:YourOwnerId:log: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.key.rest.Gs2KeyRestClient;
import io.gs2.key.request.CreateNamespaceRequest;
import io.gs2.key.result.CreateNamespaceResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2KeyRestClient client = new Gs2KeyRestClient(session);

try {
    CreateNamespaceResult result = client.createNamespace(
        new CreateNamespaceRequest()
            .withName("namespace1")
            .withDescription(null)
            .withLogSetting(new io.gs2.key.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log: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.Gs2Key.Gs2KeyRestClient;
using Gs2.Gs2Key.Request.CreateNamespaceRequest;
using Gs2.Gs2Key.Result.CreateNamespaceResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.createNamespace(
    new CreateNamespaceRequest()
        .withName("namespace1")
        .withDescription(null)
        .withLogSetting(new Gs2.Gs2Key.Model.LogSetting()
            .WithLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log: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 Gs2Key from '@/gs2/key';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Key.Gs2KeyRestClient(session);

try {
    const result = await client.createNamespace(
        new Gs2Key.CreateNamespaceRequest()
            .withName('namespace1')
            .withDescription(undefined)
            .withLogSetting(new Gs2Key.Model.LogSetting()
                .withLoggingNamespaceId('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1'))
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import key

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

try:
    result = client.create_namespace(
        new key.CreateNamespaceRequest()
            .with_name(self.hash1)
            .with_description(None)
            .with_log_setting(
                key.LogSetting()
                    .with_logging_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1'))
    )
    item = result.item
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('key')

api_result = client.create_namespace({
    name='namespace1',
    description=nil,
    logSetting={
        loggingNamespaceId='grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1',
    },
});

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文字 説明文
logSetting LogSetting ログの出力設定

Result

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

getNamespaceStatus

getNamespaceStatus

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/key"
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 := key.Gs2KeyRestClient{
    Session: &session,
}
result, err := client.GetNamespaceStatus(
    &key.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\Key\Gs2KeyRestClient;
use Gs2\Key\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.key.rest.Gs2KeyRestClient;
import io.gs2.key.request.GetNamespaceStatusRequest;
import io.gs2.key.result.GetNamespaceStatusResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2KeyRestClient client = new Gs2KeyRestClient(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.Gs2Key.Gs2KeyRestClient;
using Gs2.Gs2Key.Request.GetNamespaceStatusRequest;
using Gs2.Gs2Key.Result.GetNamespaceStatusResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2KeyRestClient(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 Gs2Key from '@/gs2/key';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Key.Gs2KeyRestClient(session);

try {
    const result = await client.getNamespaceStatus(
        new Gs2Key.GetNamespaceStatusRequest()
            .withNamespaceName('namespace1')
    );
    const status = result.getStatus();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import key

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

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

client = gs2('key')

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/key"
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 := key.Gs2KeyRestClient{
    Session: &session,
}
result, err := client.GetNamespace(
    &key.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\Key\Gs2KeyRestClient;
use Gs2\Key\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.key.rest.Gs2KeyRestClient;
import io.gs2.key.request.GetNamespaceRequest;
import io.gs2.key.result.GetNamespaceResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2KeyRestClient client = new Gs2KeyRestClient(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.Gs2Key.Gs2KeyRestClient;
using Gs2.Gs2Key.Request.GetNamespaceRequest;
using Gs2.Gs2Key.Result.GetNamespaceResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2KeyRestClient(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 Gs2Key from '@/gs2/key';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Key.Gs2KeyRestClient(session);

try {
    const result = await client.getNamespace(
        new Gs2Key.GetNamespaceRequest()
            .withNamespaceName('namespace1')
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import key

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

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

client = gs2('key')

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/key"
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 := key.Gs2KeyRestClient{
    Session: &session,
}
result, err := client.UpdateNamespace(
    &key.UpdateNamespaceRequest {
        NamespaceName: pointy.String("namespace1"),
        Description: pointy.String("description1"),
        LogSetting: &key.LogSetting{
            LoggingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:log: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\Key\Gs2KeyRestClient;
use Gs2\Key\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')
            ->withLogSetting((new \Gs2\Key\Model\LogSetting())
                ->withLoggingNamespaceId('grn:gs2:ap-northeast-1:YourOwnerId:log: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.key.rest.Gs2KeyRestClient;
import io.gs2.key.request.UpdateNamespaceRequest;
import io.gs2.key.result.UpdateNamespaceResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2KeyRestClient client = new Gs2KeyRestClient(session);

try {
    UpdateNamespaceResult result = client.updateNamespace(
        new UpdateNamespaceRequest()
            .withNamespaceName("namespace1")
            .withDescription("description1")
            .withLogSetting(new io.gs2.key.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log: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.Gs2Key.Gs2KeyRestClient;
using Gs2.Gs2Key.Request.UpdateNamespaceRequest;
using Gs2.Gs2Key.Result.UpdateNamespaceResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.updateNamespace(
    new UpdateNamespaceRequest()
        .withNamespaceName("namespace1")
        .withDescription("description1")
        .withLogSetting(new Gs2.Gs2Key.Model.LogSetting()
            .WithLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log: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 Gs2Key from '@/gs2/key';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Key.Gs2KeyRestClient(session);

try {
    const result = await client.updateNamespace(
        new Gs2Key.UpdateNamespaceRequest()
            .withNamespaceName('namespace1')
            .withDescription('description1')
            .withLogSetting(new Gs2Key.Model.LogSetting()
                .withLoggingNamespaceId('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1'))
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import key

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

try:
    result = client.update_namespace(
        new key.UpdateNamespaceRequest()
            .with_namespace_name(self.hash1)
            .with_description('description1')
            .with_log_setting(
                key.LogSetting()
                    .with_logging_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1'))
    )
    item = result.item
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('key')

api_result = client.update_namespace({
    namespaceName='namespace1',
    description='description1',
    logSetting={
        loggingNamespaceId='grn:gs2:ap-northeast-1:YourOwnerId:log: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文字 ネームスペース名
description string ~ 1024文字 説明文
logSetting LogSetting ログの出力設定

Result

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

deleteNamespace

deleteNamespace

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/key"
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 := key.Gs2KeyRestClient{
    Session: &session,
}
result, err := client.DeleteNamespace(
    &key.DeleteNamespaceRequest {
        NamespaceName: pointy.String("namespace1"),
    }
)
if err != nil {
    panic("error occurred")
}
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Key\Gs2KeyRestClient;
use Gs2\Key\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)
    );
} 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.key.rest.Gs2KeyRestClient;
import io.gs2.key.request.DeleteNamespaceRequest;
import io.gs2.key.result.DeleteNamespaceResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2KeyRestClient client = new Gs2KeyRestClient(session);

try {
    DeleteNamespaceResult result = client.deleteNamespace(
        new DeleteNamespaceRequest()
            .withNamespaceName("namespace1")
    );
} 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.Gs2Key.Gs2KeyRestClient;
using Gs2.Gs2Key.Request.DeleteNamespaceRequest;
using Gs2.Gs2Key.Result.DeleteNamespaceResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2KeyRestClient(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;
import Gs2Core from '@/gs2/core';
import * as Gs2Key from '@/gs2/key';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Key.Gs2KeyRestClient(session);

try {
    const result = await client.deleteNamespace(
        new Gs2Key.DeleteNamespaceRequest()
            .withNamespaceName('namespace1')
    );
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import key

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

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

client = gs2('key')

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

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

result = api_result.result

ネームスペースを削除

Request

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

Result

説明

describeKeys

describeKeys

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/key"
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 := key.Gs2KeyRestClient{
    Session: &session,
}
result, err := client.DescribeKeys(
    &key.DescribeKeysRequest {
        NamespaceName: pointy.String("namespace1"),
        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\Key\Gs2KeyRestClient;
use Gs2\Key\Request\DescribeKeysRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeKeys(
        (new DescribeKeysRequest())
            ->withNamespaceName(self::namespace1)
            ->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.key.rest.Gs2KeyRestClient;
import io.gs2.key.request.DescribeKeysRequest;
import io.gs2.key.result.DescribeKeysResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2KeyRestClient client = new Gs2KeyRestClient(session);

try {
    DescribeKeysResult result = client.describeKeys(
        new DescribeKeysRequest()
            .withNamespaceName("namespace1")
            .withPageToken(null)
            .withLimit(null)
    );
    List<Key> 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.Gs2Key.Gs2KeyRestClient;
using Gs2.Gs2Key.Request.DescribeKeysRequest;
using Gs2.Gs2Key.Result.DescribeKeysResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.describeKeys(
    new DescribeKeysRequest()
        .withNamespaceName("namespace1")
        .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 Gs2Key from '@/gs2/key';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Key.Gs2KeyRestClient(session);

try {
    const result = await client.describeKeys(
        new Gs2Key.DescribeKeysRequest()
            .withNamespaceName('namespace1')
            .withPageToken(undefined)
            .withLimit(undefined)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import key

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

try:
    result = client.describe_keys(
        new key.DescribeKeysRequest()
            .with_namespace_name(self.hash1)
            .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('key')

api_result = client.describe_keys({
    namespaceName='namespace1',
    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

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

Result

説明
items Key[] 暗号鍵のリスト
nextPageToken string リストの続きを取得するためのページトークン

createKey

createKey

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/key"
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 := key.Gs2KeyRestClient{
    Session: &session,
}
result, err := client.CreateKey(
    &key.CreateKeyRequest {
        NamespaceName: pointy.String("namespace1"),
        Name: pointy.String("key-0001"),
        Description: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Key\Gs2KeyRestClient;
use Gs2\Key\Request\CreateKeyRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->createKey(
        (new CreateKeyRequest())
            ->withNamespaceName(self::namespace1)
            ->withName('key-0001')
            ->withDescription(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.key.rest.Gs2KeyRestClient;
import io.gs2.key.request.CreateKeyRequest;
import io.gs2.key.result.CreateKeyResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2KeyRestClient client = new Gs2KeyRestClient(session);

try {
    CreateKeyResult result = client.createKey(
        new CreateKeyRequest()
            .withNamespaceName("namespace1")
            .withName("key-0001")
            .withDescription(null)
    );
    Key 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.Gs2Key.Gs2KeyRestClient;
using Gs2.Gs2Key.Request.CreateKeyRequest;
using Gs2.Gs2Key.Result.CreateKeyResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.createKey(
    new CreateKeyRequest()
        .withNamespaceName("namespace1")
        .withName("key-0001")
        .withDescription(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Key from '@/gs2/key';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Key.Gs2KeyRestClient(session);

try {
    const result = await client.createKey(
        new Gs2Key.CreateKeyRequest()
            .withNamespaceName('namespace1')
            .withName('key-0001')
            .withDescription(undefined)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import key

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

try:
    result = client.create_key(
        new key.CreateKeyRequest()
            .with_namespace_name(self.hash1)
            .with_name('key-0001')
            .with_description(None)
    )
    item = result.item
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('key')

api_result = client.create_key({
    namespaceName='namespace1',
    name='key-0001',
    description=nil,
});

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

result = api_result.result
item = result.item;

暗号鍵を新規作成します

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
name string ~ 128文字 暗号鍵名
description string ~ 1024文字 説明文

Result

説明
item Key 作成した暗号鍵

updateKey

updateKey

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/key"
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 := key.Gs2KeyRestClient{
    Session: &session,
}
result, err := client.UpdateKey(
    &key.UpdateKeyRequest {
        NamespaceName: pointy.String("namespace1"),
        KeyName: pointy.String("key-0001"),
        Description: pointy.String("description1"),
    }
)
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\Key\Gs2KeyRestClient;
use Gs2\Key\Request\UpdateKeyRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateKey(
        (new UpdateKeyRequest())
            ->withNamespaceName(self::namespace1)
            ->withKeyName('key-0001')
            ->withDescription('description1')
    );
    $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.key.rest.Gs2KeyRestClient;
import io.gs2.key.request.UpdateKeyRequest;
import io.gs2.key.result.UpdateKeyResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2KeyRestClient client = new Gs2KeyRestClient(session);

try {
    UpdateKeyResult result = client.updateKey(
        new UpdateKeyRequest()
            .withNamespaceName("namespace1")
            .withKeyName("key-0001")
            .withDescription("description1")
    );
    Key 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.Gs2Key.Gs2KeyRestClient;
using Gs2.Gs2Key.Request.UpdateKeyRequest;
using Gs2.Gs2Key.Result.UpdateKeyResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.updateKey(
    new UpdateKeyRequest()
        .withNamespaceName("namespace1")
        .withKeyName("key-0001")
        .withDescription("description1"),
    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 Gs2Key from '@/gs2/key';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Key.Gs2KeyRestClient(session);

try {
    const result = await client.updateKey(
        new Gs2Key.UpdateKeyRequest()
            .withNamespaceName('namespace1')
            .withKeyName('key-0001')
            .withDescription('description1')
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import key

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

try:
    result = client.update_key(
        new key.UpdateKeyRequest()
            .with_namespace_name(self.hash1)
            .with_key_name('key-0001')
            .with_description('description1')
    )
    item = result.item
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('key')

api_result = client.update_key({
    namespaceName='namespace1',
    keyName='key-0001',
    description='description1',
});

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

result = api_result.result
item = result.item;

暗号鍵を更新

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
keyName string ~ 128文字 暗号鍵名
description string ~ 1024文字 説明文

Result

説明
item Key 更新した暗号鍵

getKey

getKey

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/key"
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 := key.Gs2KeyRestClient{
    Session: &session,
}
result, err := client.GetKey(
    &key.GetKeyRequest {
        NamespaceName: pointy.String("namespace1"),
        KeyName: pointy.String("key-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Key\Gs2KeyRestClient;
use Gs2\Key\Request\GetKeyRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getKey(
        (new GetKeyRequest())
            ->withNamespaceName(self::namespace1)
            ->withKeyName('key-0001')
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.key.rest.Gs2KeyRestClient;
import io.gs2.key.request.GetKeyRequest;
import io.gs2.key.result.GetKeyResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2KeyRestClient client = new Gs2KeyRestClient(session);

try {
    GetKeyResult result = client.getKey(
        new GetKeyRequest()
            .withNamespaceName("namespace1")
            .withKeyName("key-0001")
    );
    Key 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.Gs2Key.Gs2KeyRestClient;
using Gs2.Gs2Key.Request.GetKeyRequest;
using Gs2.Gs2Key.Result.GetKeyResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getKey(
    new GetKeyRequest()
        .withNamespaceName("namespace1")
        .withKeyName("key-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Key from '@/gs2/key';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Key.Gs2KeyRestClient(session);

try {
    const result = await client.getKey(
        new Gs2Key.GetKeyRequest()
            .withNamespaceName('namespace1')
            .withKeyName('key-0001')
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import key

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

try:
    result = client.get_key(
        new key.GetKeyRequest()
            .with_namespace_name(self.hash1)
            .with_key_name('key-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('key')

api_result = client.get_key({
    namespaceName='namespace1',
    keyName='key-0001',
});

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

result = api_result.result
item = result.item;

暗号鍵を取得します

Request

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

Result

説明
item Key 暗号鍵

deleteKey

deleteKey

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/key"
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 := key.Gs2KeyRestClient{
    Session: &session,
}
result, err := client.DeleteKey(
    &key.DeleteKeyRequest {
        NamespaceName: pointy.String("namespace1"),
        KeyName: pointy.String("key-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Key\Gs2KeyRestClient;
use Gs2\Key\Request\DeleteKeyRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteKey(
        (new DeleteKeyRequest())
            ->withNamespaceName(self::namespace1)
            ->withKeyName('key-0001')
    );
} 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.key.rest.Gs2KeyRestClient;
import io.gs2.key.request.DeleteKeyRequest;
import io.gs2.key.result.DeleteKeyResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2KeyRestClient client = new Gs2KeyRestClient(session);

try {
    DeleteKeyResult result = client.deleteKey(
        new DeleteKeyRequest()
            .withNamespaceName("namespace1")
            .withKeyName("key-0001")
    );
} 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.Gs2Key.Gs2KeyRestClient;
using Gs2.Gs2Key.Request.DeleteKeyRequest;
using Gs2.Gs2Key.Result.DeleteKeyResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.deleteKey(
    new DeleteKeyRequest()
        .withNamespaceName("namespace1")
        .withKeyName("key-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
import Gs2Core from '@/gs2/core';
import * as Gs2Key from '@/gs2/key';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Key.Gs2KeyRestClient(session);

try {
    const result = await client.deleteKey(
        new Gs2Key.DeleteKeyRequest()
            .withNamespaceName('namespace1')
            .withKeyName('key-0001')
    );
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import key

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

try:
    result = client.delete_key(
        new key.DeleteKeyRequest()
            .with_namespace_name(self.hash1)
            .with_key_name('key-0001')
    )
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('key')

api_result = client.delete_key({
    namespaceName='namespace1',
    keyName='key-0001',
});

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

result = api_result.result

暗号鍵を削除します

Request

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

Result

説明

encrypt

encrypt

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/key"
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 := key.Gs2KeyRestClient{
    Session: &session,
}
result, err := client.Encrypt(
    &key.EncryptRequest {
        NamespaceName: pointy.String("namespace1"),
        KeyName: pointy.String("key-0001"),
        Data: pointy.String("hoge"),
    }
)
if err != nil {
    panic("error occurred")
}
data := result.Data
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Key\Gs2KeyRestClient;
use Gs2\Key\Request\EncryptRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->encrypt(
        (new EncryptRequest())
            ->withNamespaceName(self::namespace1)
            ->withKeyName('key-0001')
            ->withData('hoge')
    );
    $data = $result->getData();
} 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.key.rest.Gs2KeyRestClient;
import io.gs2.key.request.EncryptRequest;
import io.gs2.key.result.EncryptResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2KeyRestClient client = new Gs2KeyRestClient(session);

try {
    EncryptResult result = client.encrypt(
        new EncryptRequest()
            .withNamespaceName("namespace1")
            .withKeyName("key-0001")
            .withData("hoge")
    );
    String data = result.getData();
} 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.Gs2Key.Gs2KeyRestClient;
using Gs2.Gs2Key.Request.EncryptRequest;
using Gs2.Gs2Key.Result.EncryptResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.encrypt(
    new EncryptRequest()
        .withNamespaceName("namespace1")
        .withKeyName("key-0001")
        .withData("hoge"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var data = result.Data;
import Gs2Core from '@/gs2/core';
import * as Gs2Key from '@/gs2/key';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Key.Gs2KeyRestClient(session);

try {
    const result = await client.encrypt(
        new Gs2Key.EncryptRequest()
            .withNamespaceName('namespace1')
            .withKeyName('key-0001')
            .withData('hoge')
    );
    const data = result.getData();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import key

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

try:
    result = client.encrypt(
        new key.EncryptRequest()
            .with_namespace_name(self.hash1)
            .with_key_name('key-0001')
            .with_data('hoge')
    )
    data = result.data
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('key')

api_result = client.encrypt({
    namespaceName='namespace1',
    keyName='key-0001',
    data='hoge',
});

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

result = api_result.result
data = result.data;

データを暗号化します

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
keyName string ~ 128文字 暗号鍵名
data string ~ 1048576文字

Result

説明
data string 暗号化済みデータ

decrypt

decrypt

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/key"
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 := key.Gs2KeyRestClient{
    Session: &session,
}
result, err := client.Decrypt(
    &key.DecryptRequest {
        NamespaceName: pointy.String("namespace1"),
        KeyName: pointy.String("key-0001"),
        Data: pointy.String("hoge"),
    }
)
if err != nil {
    panic("error occurred")
}
data := result.Data
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Key\Gs2KeyRestClient;
use Gs2\Key\Request\DecryptRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->decrypt(
        (new DecryptRequest())
            ->withNamespaceName(self::namespace1)
            ->withKeyName('key-0001')
            ->withData('hoge')
    );
    $data = $result->getData();
} 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.key.rest.Gs2KeyRestClient;
import io.gs2.key.request.DecryptRequest;
import io.gs2.key.result.DecryptResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2KeyRestClient client = new Gs2KeyRestClient(session);

try {
    DecryptResult result = client.decrypt(
        new DecryptRequest()
            .withNamespaceName("namespace1")
            .withKeyName("key-0001")
            .withData("hoge")
    );
    String data = result.getData();
} 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.Gs2Key.Gs2KeyRestClient;
using Gs2.Gs2Key.Request.DecryptRequest;
using Gs2.Gs2Key.Result.DecryptResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.decrypt(
    new DecryptRequest()
        .withNamespaceName("namespace1")
        .withKeyName("key-0001")
        .withData("hoge"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var data = result.Data;
import Gs2Core from '@/gs2/core';
import * as Gs2Key from '@/gs2/key';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Key.Gs2KeyRestClient(session);

try {
    const result = await client.decrypt(
        new Gs2Key.DecryptRequest()
            .withNamespaceName('namespace1')
            .withKeyName('key-0001')
            .withData('hoge')
    );
    const data = result.getData();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import key

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

try:
    result = client.decrypt(
        new key.DecryptRequest()
            .with_namespace_name(self.hash1)
            .with_key_name('key-0001')
            .with_data('hoge')
    )
    data = result.data
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('key')

api_result = client.decrypt({
    namespaceName='namespace1',
    keyName='key-0001',
    data='hoge',
});

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

result = api_result.result
data = result.data;

データを復号します

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
keyName string ~ 128文字 暗号鍵名
data string ~ 1048576文字

Result

説明
data string 復号済みデータ

describeGitHubApiKeys

describeGitHubApiKeys

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/key"
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 := key.Gs2KeyRestClient{
    Session: &session,
}
result, err := client.DescribeGitHubApiKeys(
    &key.DescribeGitHubApiKeysRequest {
        NamespaceName: pointy.String("namespace1"),
        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\Key\Gs2KeyRestClient;
use Gs2\Key\Request\DescribeGitHubApiKeysRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeGitHubApiKeys(
        (new DescribeGitHubApiKeysRequest())
            ->withNamespaceName(self::namespace1)
            ->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.key.rest.Gs2KeyRestClient;
import io.gs2.key.request.DescribeGitHubApiKeysRequest;
import io.gs2.key.result.DescribeGitHubApiKeysResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2KeyRestClient client = new Gs2KeyRestClient(session);

try {
    DescribeGitHubApiKeysResult result = client.describeGitHubApiKeys(
        new DescribeGitHubApiKeysRequest()
            .withNamespaceName("namespace1")
            .withPageToken(null)
            .withLimit(null)
    );
    List<GitHubApiKey> 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.Gs2Key.Gs2KeyRestClient;
using Gs2.Gs2Key.Request.DescribeGitHubApiKeysRequest;
using Gs2.Gs2Key.Result.DescribeGitHubApiKeysResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.describeGitHubApiKeys(
    new DescribeGitHubApiKeysRequest()
        .withNamespaceName("namespace1")
        .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 Gs2Key from '@/gs2/key';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Key.Gs2KeyRestClient(session);

try {
    const result = await client.describeGitHubApiKeys(
        new Gs2Key.DescribeGitHubApiKeysRequest()
            .withNamespaceName('namespace1')
            .withPageToken(undefined)
            .withLimit(undefined)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import key

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

try:
    result = client.describe_git_hub_api_keys(
        new key.DescribeGitHubApiKeysRequest()
            .with_namespace_name(self.hash1)
            .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('key')

api_result = client.describe_git_hub_api_keys({
    namespaceName='namespace1',
    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;

GitHub のAPIキーの一覧を取得します

Request

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

Result

説明
items GitHubApiKey[] GitHub のAPIキーのリスト
nextPageToken string リストの続きを取得するためのページトークン

createGitHubApiKey

createGitHubApiKey

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/key"
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 := key.Gs2KeyRestClient{
    Session: &session,
}
result, err := client.CreateGitHubApiKey(
    &key.CreateGitHubApiKeyRequest {
        NamespaceName: pointy.String("namespace1"),
        Name: pointy.String("api-key-0001"),
        Description: nil,
        ApiKey: pointy.String("secret-0001"),
        EncryptionKeyName: pointy.String("$key1.name"),
    }
)
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\Key\Gs2KeyRestClient;
use Gs2\Key\Request\CreateGitHubApiKeyRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->createGitHubApiKey(
        (new CreateGitHubApiKeyRequest())
            ->withNamespaceName(self::namespace1)
            ->withName('api-key-0001')
            ->withDescription(null)
            ->withApiKey('secret-0001')
            ->withEncryptionKeyName(self::$key1.name)
    );
    $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.key.rest.Gs2KeyRestClient;
import io.gs2.key.request.CreateGitHubApiKeyRequest;
import io.gs2.key.result.CreateGitHubApiKeyResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2KeyRestClient client = new Gs2KeyRestClient(session);

try {
    CreateGitHubApiKeyResult result = client.createGitHubApiKey(
        new CreateGitHubApiKeyRequest()
            .withNamespaceName("namespace1")
            .withName("api-key-0001")
            .withDescription(null)
            .withApiKey("secret-0001")
            .withEncryptionKeyName("$key1.name")
    );
    GitHubApiKey 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.Gs2Key.Gs2KeyRestClient;
using Gs2.Gs2Key.Request.CreateGitHubApiKeyRequest;
using Gs2.Gs2Key.Result.CreateGitHubApiKeyResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.createGitHubApiKey(
    new CreateGitHubApiKeyRequest()
        .withNamespaceName("namespace1")
        .withName("api-key-0001")
        .withDescription(null)
        .withApiKey("secret-0001")
        .withEncryptionKeyName("$key1.name"),
    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 Gs2Key from '@/gs2/key';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Key.Gs2KeyRestClient(session);

try {
    const result = await client.createGitHubApiKey(
        new Gs2Key.CreateGitHubApiKeyRequest()
            .withNamespaceName('namespace1')
            .withName('api-key-0001')
            .withDescription(undefined)
            .withApiKey('secret-0001')
            .withEncryptionKeyName('$key1.name')
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import key

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

try:
    result = client.create_git_hub_api_key(
        new key.CreateGitHubApiKeyRequest()
            .with_namespace_name(self.hash1)
            .with_name('api-key-0001')
            .with_description(None)
            .with_api_key('secret-0001')
            .with_encryption_key_name(self.key1.name)
    )
    item = result.item
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('key')

api_result = client.create_git_hub_api_key({
    namespaceName='namespace1',
    name='api-key-0001',
    description=nil,
    apiKey='secret-0001',
    encryptionKeyName='$key1.name',
});

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

result = api_result.result
item = result.item;

GitHub のAPIキーを新規作成します

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
name string ~ 128文字 GitHub APIキー名
description string ~ 1024文字 説明文
encryptionKeyName string ~ 128文字 APIキーの暗号化に使用する暗号鍵名

Result

説明
item GitHubApiKey 作成したGitHub のAPIキー

updateGitHubApiKey

updateGitHubApiKey

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/key"
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 := key.Gs2KeyRestClient{
    Session: &session,
}
result, err := client.UpdateGitHubApiKey(
    &key.UpdateGitHubApiKeyRequest {
        NamespaceName: pointy.String("namespace1"),
        ApiKeyName: pointy.String("api-key-0001"),
        Description: pointy.String("description1"),
        ApiKey: pointy.String("secret-0004"),
        EncryptionKeyName: pointy.String("$key1.name"),
    }
)
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\Key\Gs2KeyRestClient;
use Gs2\Key\Request\UpdateGitHubApiKeyRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateGitHubApiKey(
        (new UpdateGitHubApiKeyRequest())
            ->withNamespaceName(self::namespace1)
            ->withApiKeyName('api-key-0001')
            ->withDescription('description1')
            ->withApiKey('secret-0004')
            ->withEncryptionKeyName(self::$key1.name)
    );
    $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.key.rest.Gs2KeyRestClient;
import io.gs2.key.request.UpdateGitHubApiKeyRequest;
import io.gs2.key.result.UpdateGitHubApiKeyResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2KeyRestClient client = new Gs2KeyRestClient(session);

try {
    UpdateGitHubApiKeyResult result = client.updateGitHubApiKey(
        new UpdateGitHubApiKeyRequest()
            .withNamespaceName("namespace1")
            .withApiKeyName("api-key-0001")
            .withDescription("description1")
            .withApiKey("secret-0004")
            .withEncryptionKeyName("$key1.name")
    );
    GitHubApiKey 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.Gs2Key.Gs2KeyRestClient;
using Gs2.Gs2Key.Request.UpdateGitHubApiKeyRequest;
using Gs2.Gs2Key.Result.UpdateGitHubApiKeyResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.updateGitHubApiKey(
    new UpdateGitHubApiKeyRequest()
        .withNamespaceName("namespace1")
        .withApiKeyName("api-key-0001")
        .withDescription("description1")
        .withApiKey("secret-0004")
        .withEncryptionKeyName("$key1.name"),
    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 Gs2Key from '@/gs2/key';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Key.Gs2KeyRestClient(session);

try {
    const result = await client.updateGitHubApiKey(
        new Gs2Key.UpdateGitHubApiKeyRequest()
            .withNamespaceName('namespace1')
            .withApiKeyName('api-key-0001')
            .withDescription('description1')
            .withApiKey('secret-0004')
            .withEncryptionKeyName('$key1.name')
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import key

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

try:
    result = client.update_git_hub_api_key(
        new key.UpdateGitHubApiKeyRequest()
            .with_namespace_name(self.hash1)
            .with_api_key_name('api-key-0001')
            .with_description('description1')
            .with_api_key('secret-0004')
            .with_encryption_key_name(self.key1.name)
    )
    item = result.item
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('key')

api_result = client.update_git_hub_api_key({
    namespaceName='namespace1',
    apiKeyName='api-key-0001',
    description='description1',
    apiKey='secret-0004',
    encryptionKeyName='$key1.name',
});

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

result = api_result.result
item = result.item;

GitHub のAPIキーを更新

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
apiKeyName string ~ 128文字 GitHub APIキー名
description string ~ 1024文字 説明文
encryptionKeyName string ~ 128文字 APIキーの暗号化に使用する暗号鍵名

Result

説明
item GitHubApiKey 更新したGitHub のAPIキー

getGitHubApiKey

getGitHubApiKey

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/key"
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 := key.Gs2KeyRestClient{
    Session: &session,
}
result, err := client.GetGitHubApiKey(
    &key.GetGitHubApiKeyRequest {
        NamespaceName: pointy.String("namespace1"),
        ApiKeyName: pointy.String("api-key-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Key\Gs2KeyRestClient;
use Gs2\Key\Request\GetGitHubApiKeyRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getGitHubApiKey(
        (new GetGitHubApiKeyRequest())
            ->withNamespaceName(self::namespace1)
            ->withApiKeyName('api-key-0001')
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.key.rest.Gs2KeyRestClient;
import io.gs2.key.request.GetGitHubApiKeyRequest;
import io.gs2.key.result.GetGitHubApiKeyResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2KeyRestClient client = new Gs2KeyRestClient(session);

try {
    GetGitHubApiKeyResult result = client.getGitHubApiKey(
        new GetGitHubApiKeyRequest()
            .withNamespaceName("namespace1")
            .withApiKeyName("api-key-0001")
    );
    GitHubApiKey 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.Gs2Key.Gs2KeyRestClient;
using Gs2.Gs2Key.Request.GetGitHubApiKeyRequest;
using Gs2.Gs2Key.Result.GetGitHubApiKeyResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getGitHubApiKey(
    new GetGitHubApiKeyRequest()
        .withNamespaceName("namespace1")
        .withApiKeyName("api-key-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Key from '@/gs2/key';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Key.Gs2KeyRestClient(session);

try {
    const result = await client.getGitHubApiKey(
        new Gs2Key.GetGitHubApiKeyRequest()
            .withNamespaceName('namespace1')
            .withApiKeyName('api-key-0001')
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import key

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

try:
    result = client.get_git_hub_api_key(
        new key.GetGitHubApiKeyRequest()
            .with_namespace_name(self.hash1)
            .with_api_key_name('api-key-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('key')

api_result = client.get_git_hub_api_key({
    namespaceName='namespace1',
    apiKeyName='api-key-0001',
});

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

result = api_result.result
item = result.item;

GitHub のAPIキーを取得します

Request

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

Result

説明
item GitHubApiKey GitHub のAPIキー

deleteGitHubApiKey

deleteGitHubApiKey

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/key"
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 := key.Gs2KeyRestClient{
    Session: &session,
}
result, err := client.DeleteGitHubApiKey(
    &key.DeleteGitHubApiKeyRequest {
        NamespaceName: pointy.String("namespace1"),
        ApiKeyName: pointy.String("api-key-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Key\Gs2KeyRestClient;
use Gs2\Key\Request\DeleteGitHubApiKeyRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteGitHubApiKey(
        (new DeleteGitHubApiKeyRequest())
            ->withNamespaceName(self::namespace1)
            ->withApiKeyName('api-key-0001')
    );
} 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.key.rest.Gs2KeyRestClient;
import io.gs2.key.request.DeleteGitHubApiKeyRequest;
import io.gs2.key.result.DeleteGitHubApiKeyResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2KeyRestClient client = new Gs2KeyRestClient(session);

try {
    DeleteGitHubApiKeyResult result = client.deleteGitHubApiKey(
        new DeleteGitHubApiKeyRequest()
            .withNamespaceName("namespace1")
            .withApiKeyName("api-key-0001")
    );
} 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.Gs2Key.Gs2KeyRestClient;
using Gs2.Gs2Key.Request.DeleteGitHubApiKeyRequest;
using Gs2.Gs2Key.Result.DeleteGitHubApiKeyResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.deleteGitHubApiKey(
    new DeleteGitHubApiKeyRequest()
        .withNamespaceName("namespace1")
        .withApiKeyName("api-key-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
import Gs2Core from '@/gs2/core';
import * as Gs2Key from '@/gs2/key';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Key.Gs2KeyRestClient(session);

try {
    const result = await client.deleteGitHubApiKey(
        new Gs2Key.DeleteGitHubApiKeyRequest()
            .withNamespaceName('namespace1')
            .withApiKeyName('api-key-0001')
    );
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import key

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

try:
    result = client.delete_git_hub_api_key(
        new key.DeleteGitHubApiKeyRequest()
            .with_namespace_name(self.hash1)
            .with_api_key_name('api-key-0001')
    )
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('key')

api_result = client.delete_git_hub_api_key({
    namespaceName='namespace1',
    apiKeyName='api-key-0001',
});

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

result = api_result.result

GitHub のAPIキーを削除します

Request

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

Result

説明