GS2-Lock¶
Create Client
lock_client = client('lock')
目次
Method¶
create_lock_pool¶
response = lock_client:create_lock_pool(request)
if response.isError then
-- エラー処理 --
print(response.statusCode)
print(response.errorMessage)
else
-- 正常処理 --
print(response.result)
end
ロックプールを新規作成します
Request¶
{
name=string,
description=string,
serviceClass=string,
}
- name
- [string] ロックプールの名前
- description
- [string] 説明文
- serviceClass
- [string] サービスクラス
delete_lock_pool¶
response = lock_client:delete_lock_pool(request)
if response.isError then
-- エラー処理 --
print(response.statusCode)
print(response.errorMessage)
else
-- 正常処理 --
print(response.result)
end
ロックプールを削除します
Response¶
None
describe_lock_pool¶
response = lock_client:describe_lock_pool(request)
if response.isError then
-- エラー処理 --
print(response.statusCode)
print(response.errorMessage)
else
-- 正常処理 --
print(response.result)
end
ロックプールの一覧を取得します
Request¶
{
pageToken=string,
limit=number,
}
- pageToken
- [string] データの取得を開始する位置を指定するトークン
- limit
- [number] データの取得件数
describe_service_class¶
response = lock_client:describe_service_class(request)
if response.isError then
-- エラー処理 --
print(response.statusCode)
print(response.errorMessage)
else
-- 正常処理 --
print(response.result)
end
サービスクラスの一覧を取得します
Request¶
{
}
get_lock_pool¶
response = lock_client:get_lock_pool(request)
if response.isError then
-- エラー処理 --
print(response.statusCode)
print(response.errorMessage)
else
-- 正常処理 --
print(response.result)
end
ロックプールを取得します
get_lock_pool_status¶
response = lock_client:get_lock_pool_status(request)
if response.isError then
-- エラー処理 --
print(response.statusCode)
print(response.errorMessage)
else
-- 正常処理 --
print(response.result)
end
ロックプールの状態を取得します
lock¶
response = lock_client:lock(request)
if response.isError then
-- エラー処理 --
print(response.statusCode)
print(response.errorMessage)
else
-- 正常処理 --
print(response.result)
end
ロックを取得します。
Request¶
{
lockPoolName=string,
transactionId=string,
resourceName=string,
ttl=number,
accessToken=string
}
- lockPoolName
- [string] ロックプールの名前を指定します。
- transactionId
- [string] トランザクションID
- resourceName
- [string] ロック解除するリソースの名前
- ttl
- [number] ロックの有効期間(秒)
- accessToken
- [string] GS2-Auth で発行を受けたアクセストークン
lock_by_user¶
response = lock_client:lock_by_user(request)
if response.isError then
-- エラー処理 --
print(response.statusCode)
print(response.errorMessage)
else
-- 正常処理 --
print(response.result)
end
ロックを取得します。
Request¶
{
lockPoolName=string,
userId=string,
transactionId=string,
resourceName=string,
ttl=number,
}
- lockPoolName
- [string] ロックプールの名前を指定します。
- userId
- [string] ユーザID
- transactionId
- [string] トランザクションID
- resourceName
- [string] ロック解除するリソースの名前
- ttl
- [number] ロックの有効期間(秒)
unlock¶
response = lock_client:unlock(request)
if response.isError then
-- エラー処理 --
print(response.statusCode)
print(response.errorMessage)
else
-- 正常処理 --
print(response.result)
end
アンロックします。
Request¶
{
lockPoolName=string,
transactionId=string,
resourceName=string,
accessToken=string
}
- lockPoolName
- [string] ロックプールの名前を指定します。
- transactionId
- [string] トランザクションID
- resourceName
- [string] ロック解除するリソースの名前
- accessToken
- [string] GS2-Auth で発行を受けたアクセストークン
Response¶
None
unlock_by_user¶
response = lock_client:unlock_by_user(request)
if response.isError then
-- エラー処理 --
print(response.statusCode)
print(response.errorMessage)
else
-- 正常処理 --
print(response.result)
end
アンロックします。
Request¶
{
lockPoolName=string,
userId=string,
transactionId=string,
resourceName=string,
}
- lockPoolName
- [string] ロックプールの名前を指定します。
- userId
- [string] ユーザID
- transactionId
- [string] トランザクションID
- resourceName
- [string] ロック解除するリソースの名前
Response¶
None
unlock_force_by_user¶
response = lock_client:unlock_force_by_user(request)
if response.isError then
-- エラー処理 --
print(response.statusCode)
print(response.errorMessage)
else
-- 正常処理 --
print(response.result)
end
強制的にアンロックします。
このAPIを利用すると、トランザクションやロックカウンターの状態を無視して強制的にアンロック出来ます。
Request¶
{
lockPoolName=string,
userId=string,
resourceName=string,
}
- lockPoolName
- [string] ロックプールの名前を指定します。
- userId
- [string] ユーザID
- resourceName
- [string] ロック解除するリソースの名前
Response¶
None
update_lock_pool¶
response = lock_client:update_lock_pool(request)
if response.isError then
-- エラー処理 --
print(response.statusCode)
print(response.errorMessage)
else
-- 正常処理 --
print(response.result)
end
ロックプールを更新します
Request¶
{
lockPoolName=string,
description=string,
serviceClass=string,
}
- lockPoolName
- [string] ロックプールの名前を指定します。
- description
- [string] 説明文
- serviceClass
- [string] サービスクラス