モード API

モードの詳細については モード機能 をご確認ください。

ChangeMode

x-sora-target:

Sora_20211215.ChangeMode

Sora のモードを変更します。

キー

mode

string (normal | block_new_session | block_new_connection)

mode はすべての新規コネクションを受け入れる normal 、新規セッションの受け入れを停止する block_new_session と新規コネクションの受け入れを停止する block_new_connection が指定できます。

$ http POST 127.0.0.1:3000/ \
    x-sora-target:Sora_20211215.ChangeMode \
    mode=block_new_connection \
    -vvv
POST / HTTP/1.1
Accept: application/json, */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 32
Content-Type: application/json
Host: 127.0.0.1:3000
User-Agent: HTTPie/1.0.3
x-sora-target: Sora_20211215.ChangeMode

{
    "mode": "block_new_connection"
}

HTTP/1.1 200 OK
access-control-allow-headers: Origin, X-Requested-With, Content-Type, Accept, x-sora-target
access-control-allow-methods: POST, OPTIONS
access-control-allow-origin: http://127.0.0.1:5000
access-control-max-age: 1000
content-length: 31
content-type: application/json
date: Tue, 16 Nov 2021 09:36:35 GMT
server: Cowboy

{
    "mode": "block_new_connection"
}

GetMode

x-sora-target:

Sora_20211215.GetMode

Sora のモードを取得します。

$ http POST 127.0.0.1:3000/ \
    x-sora-target:Sora_20211215.GetMode \
    -vvv
POST / HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 0
Host: 127.0.0.1:3000
User-Agent: HTTPie/1.0.3
x-sora-target: Sora_20211215.GetMode



HTTP/1.1 200 OK
access-control-allow-headers: Origin, X-Requested-With, Content-Type, Accept, x-sora-target
access-control-allow-methods: POST, OPTIONS
access-control-allow-origin: http://127.0.0.1:5000
access-control-max-age: 1000
content-length: 17
content-type: application/json
date: Tue, 16 Nov 2021 09:35:26 GMT
server: Cowboy

{
    "mode": "normal"
}
© Copyright 2024, Shiguredo Inc Created using Sphinx 7.3.7