1353 lines
34 KiB
Markdown
1353 lines
34 KiB
Markdown
|
||
|
||
# ESD 1.4.0
|
||
|
||
# 健康チェック(Ping)
|
||
|
||
<a id="opIdTestConnection"></a>
|
||
|
||
## GET 健康チェック(Ping)
|
||
|
||
GET /ping
|
||
|
||
クライアントが API に接続できるかどうかをテストし、設定が正しいかどうかを確認する。
|
||
|
||
> Response Examples
|
||
|
||
> Success
|
||
|
||
```
|
||
{
|
||
"message": "pong",
|
||
"statusCode": 200
|
||
}
|
||
```
|
||
|
||
### Responses
|
||
|
||
|HTTP ステータスコード|意味|説明|データスキーマ|
|
||
|---|---|---|---|
|
||
|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|成功|インライン|
|
||
|
||
### Responses Data Schema
|
||
|
||
HTTP ステータスコード **200**
|
||
|
||
|名前|タイプ|必須|制約事項|タイトル|説明|
|
||
|---|---|---|---|---|---|
|
||
|» message|string|true|none||none|
|
||
|» statusCode|integer|true|none||none|
|
||
|
||
# 役割(Roles)
|
||
|
||
<a id="opIdListRoles"></a>
|
||
|
||
## DELETE 役割の削除 DeleteRoles
|
||
|
||
DELETE /roles
|
||
|
||
役割の削除
|
||
Delete roles
|
||
|
||
> Body Parameters
|
||
|
||
```
|
||
{
|
||
"role_name_list": [
|
||
"role_name_1"
|
||
]
|
||
}
|
||
```
|
||
|
||
### Params
|
||
|
||
|名前|場所|タイプ|必須|説明|
|
||
|---|---|---|---|---|
|
||
|Authorization|header|string| yes |none|
|
||
|body|body|object| no |none|
|
||
|» role_name_list|body|[string]| yes |役割リスト(Role Name List)|
|
||
|
||
> Response Examples
|
||
|
||
> 204 Response
|
||
|
||
```
|
||
{}
|
||
```
|
||
|
||
### Responses
|
||
|
||
|HTTP ステータスコード|意味|説明|データスキーマ|
|
||
|---|---|---|---|
|
||
|204|[No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5)|No Content|インライン|
|
||
|
||
### Responses Data Schema
|
||
|
||
<a id="opIdCreateRole"></a>
|
||
|
||
## POST 役割の作成 CreateRole
|
||
|
||
POST /roles
|
||
|
||
新しい役割の作成
|
||
Create a new role
|
||
|
||
> Body Parameters
|
||
|
||
```
|
||
{
|
||
"role_name": "new_role_name",
|
||
"creator": "admin",
|
||
"permissions": [
|
||
"train:all",
|
||
"checkpoint:all"
|
||
]
|
||
}
|
||
```
|
||
|
||
### Params
|
||
|
||
|名前|場所|タイプ|必須|説明|
|
||
|---|---|---|---|---|
|
||
|Authorization|header|string| yes |none|
|
||
|body|body|[Role](#schemarole)| no |none|
|
||
|
||
> Response Examples
|
||
|
||
> Created
|
||
|
||
```
|
||
{
|
||
"statusCode": 201,
|
||
"message": "role created"
|
||
}
|
||
```
|
||
|
||
### Responses
|
||
|
||
|HTTP ステータスコード|意味|説明|データスキーマ|
|
||
|---|---|---|---|
|
||
|201|[Created](https://tools.ietf.org/html/rfc7231#section-6.3.2)|Created|インライン|
|
||
|
||
### Responses Data Schema
|
||
|
||
HTTP ステータスコード **201**
|
||
|
||
|名前|タイプ|必須|制約事項|タイトル|説明|
|
||
|---|---|---|---|---|---|
|
||
|» statusCode|integer|true|none||none|
|
||
|» message|string|true|none||none|
|
||
|
||
# ユーザー(Users)
|
||
|
||
<a id="opIdListUsers"></a>
|
||
|
||
## GET ユーザー一覧の取得 ListUsers
|
||
|
||
GET /users
|
||
|
||
ユーザー一覧の取得
|
||
List all users
|
||
|
||
### Params
|
||
|
||
|名前|場所|タイプ|必須|説明|
|
||
|---|---|---|---|---|
|
||
|Authorization|header|string| yes |none|
|
||
|
||
> Response Examples
|
||
|
||
> Success
|
||
|
||
```
|
||
{
|
||
"statusCode": 200,
|
||
"data": {
|
||
"users": [
|
||
{
|
||
"username": "admin",
|
||
"roles": [
|
||
"IT Operator",
|
||
"byoc"
|
||
],
|
||
"creator": "admin",
|
||
"permissions": [
|
||
"checkpoint:all",
|
||
"inference:all",
|
||
"role:all",
|
||
"sagemaker_endpoint:all",
|
||
"train:all",
|
||
"user:all"
|
||
],
|
||
"password": "********"
|
||
},
|
||
{
|
||
"username": "username",
|
||
"roles": [
|
||
"IT Operator"
|
||
],
|
||
"creator": "admin",
|
||
"permissions": [
|
||
"checkpoint:all",
|
||
"inference:all",
|
||
"role:all",
|
||
"sagemaker_endpoint:all",
|
||
"train:all",
|
||
"user:all"
|
||
],
|
||
"password": "********"
|
||
}
|
||
],
|
||
"previous_evaluated_key": "not_applicable",
|
||
"last_evaluated_key": "not_applicable"
|
||
},
|
||
"message": "OK"
|
||
}
|
||
```
|
||
|
||
### Responses
|
||
|
||
|HTTP ステータスコード|意味|説明|データスキーマ|
|
||
|---|---|---|---|
|
||
|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|成功|インライン|
|
||
|
||
### Responses Data Schema
|
||
|
||
HTTP ステータスコード **200**
|
||
|
||
|名前|タイプ|必須|制約事項|タイトル|説明|
|
||
|---|---|---|---|---|---|
|
||
|» statusCode|integer|true|none||none|
|
||
|» data|object|true|none||none|
|
||
|»» users|[object]|true|none||none|
|
||
|»»» username|string|true|none||none|
|
||
|»»» roles|[string]|true|none||none|
|
||
|»»» creator|string|true|none||none|
|
||
|»»» permissions|[string]|true|none||none|
|
||
|»»» password|string|true|none||none|
|
||
|»» previous_evaluated_key|string|true|none||none|
|
||
|»» last_evaluated_key|string|true|none||none|
|
||
|» message|string|true|none||none|
|
||
|
||
<a id="opIdCreateUser"></a>
|
||
|
||
## POST ユーザーの作成 CreateUser
|
||
|
||
POST /users
|
||
|
||
新しいユーザーを作成する
|
||
Create a new user
|
||
|
||
> Body Parameters
|
||
|
||
```
|
||
{
|
||
"username": "username",
|
||
"password": "XXXXXXXXXXXXX",
|
||
"creator": "admin",
|
||
"roles": [
|
||
"IT Operator"
|
||
]
|
||
}
|
||
```
|
||
|
||
### Params
|
||
|
||
|名前|場所|タイプ|必須|説明|
|
||
|---|---|---|---|---|
|
||
|Authorization|header|string| yes |none|
|
||
|body|body|object| no |none|
|
||
|» username|body|string| yes |ユーザー名(User Name)|
|
||
|» roles|body|[string]| yes |役割リスト(Roles)|
|
||
|» creator|body|string| yes |作成者ユーザー名(Creator User Name)|
|
||
|» permissions|body|[string]| yes |権限リスト(Permissions)|
|
||
|» password|body|string| yes |パスワード(Password)|
|
||
|
||
> Response Examples
|
||
|
||
> Created
|
||
|
||
```
|
||
{
|
||
"statusCode": 201,
|
||
"message": "Created"
|
||
}
|
||
```
|
||
|
||
### Responses
|
||
|
||
|HTTP ステータスコード|意味|説明|データスキーマ|
|
||
|---|---|---|---|
|
||
|201|[Created](https://tools.ietf.org/html/rfc7231#section-6.3.2)|Created|インライン|
|
||
|
||
### Responses Data Schema
|
||
|
||
HTTP ステータスコード **201**
|
||
|
||
|名前|タイプ|必須|制約事項|タイトル|説明|
|
||
|---|---|---|---|---|---|
|
||
|» statusCode|integer|true|none||none|
|
||
|» message|string|true|none||none|
|
||
|
||
<a id="opIdDeleteUser"></a>
|
||
|
||
## DELETE ユーザーの削除 DeleteUsers
|
||
|
||
DELETE /users
|
||
|
||
ユーザーの削除
|
||
Delete users
|
||
|
||
> Body Parameters
|
||
|
||
```
|
||
{
|
||
"user_name_list": [
|
||
"string"
|
||
]
|
||
}
|
||
```
|
||
|
||
### Params
|
||
|
||
|名前|場所|タイプ|必須|説明|
|
||
|---|---|---|---|---|
|
||
|Authorization|header|string| yes |none|
|
||
|body|body|object| no |none|
|
||
|» user_name_list|body|[string]| yes |ユーザー名リスト(User Name List)|
|
||
|
||
> Response Examples
|
||
|
||
> 204 Response
|
||
|
||
```
|
||
{}
|
||
```
|
||
|
||
### Responses
|
||
|
||
|HTTP ステータスコード|意味|説明|データスキーマ|
|
||
|---|---|---|---|
|
||
|204|[No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5)|No Content|インライン|
|
||
|
||
### Responses Data Schema
|
||
|
||
# モデルファイル(Checkpoints)
|
||
|
||
<a id="opIdCreateCheckpoint"></a>
|
||
|
||
## POST URL を使ってモデルファイルをアップロードする CreateCheckpoint
|
||
|
||
POST /checkpoints
|
||
|
||
URL を使ってモデルファイルを作成する
|
||
Create a new Checkpoint by URL
|
||
|
||
> Body Parameters
|
||
|
||
```
|
||
{
|
||
"checkpoint_type": "ControlNet",
|
||
"params": {
|
||
"message": "placeholder for chkpts upload test",
|
||
"creator": "admin"
|
||
},
|
||
"urls": [
|
||
"https://huggingface.co/lllyasviel/ControlNet-v1-1/resolve/main/control_v11p_sd15_canny.pth"
|
||
]
|
||
}
|
||
```
|
||
|
||
### Params
|
||
|
||
|名前|場所|タイプ|必須|説明|
|
||
|---|---|---|---|---|
|
||
|Authorization|header|string| yes |none|
|
||
|body|body|object| no |none|
|
||
|» checkpoint_type|body|string| yes |モデルファイルの種類(Checkpoint Type)|
|
||
|» params|body|object| yes |パラメーター(Params)|
|
||
|»» message|body|string| yes |モデルファイルの情報(Message)|
|
||
|»» creator|body|string| yes |作成者ユーザー名(Creator User Name)|
|
||
|» urls|body|[string]| yes |URLs|
|
||
|
||
> Response Examples
|
||
|
||
> Accepted
|
||
|
||
```
|
||
{
|
||
"statusCode": 202,
|
||
"message": "Checkpoint creation in progress, please check later"
|
||
}
|
||
```
|
||
|
||
### Responses
|
||
|
||
|HTTP ステータスコード|意味|説明|データスキーマ|
|
||
|---|---|---|---|
|
||
|202|[Accepted](https://tools.ietf.org/html/rfc7231#section-6.3.3)|Accepted|インライン|
|
||
|
||
### Responses Data Schema
|
||
|
||
HTTP ステータスコード **202**
|
||
|
||
|名前|タイプ|必須|制約事項|タイトル|説明|
|
||
|---|---|---|---|---|---|
|
||
|» statusCode|integer|true|none||none|
|
||
|» data|object|true|none||none|
|
||
|»» checkpoint|object|true|none||none|
|
||
|»»» id|string|true|none||none|
|
||
|»»» type|string|true|none||none|
|
||
|»»» s3_location|string|true|none||none|
|
||
|»»» status|string|true|none||none|
|
||
|»»» params|object|true|none||none|
|
||
|»»»» message|string|true|none||none|
|
||
|»»»» creator|string|true|none||none|
|
||
|»»»» created|string|true|none||none|
|
||
|»»»» multipart_upload|object|true|none||none|
|
||
|»»»»» v1-5-pruned-emaonly.safetensors2|object|true|none||none|
|
||
|»»»»»» upload_id|string|true|none||none|
|
||
|»»»»»» bucket|string|true|none||none|
|
||
|»»»»»» key|string|true|none||none|
|
||
|»» s3PresignUrl|object|true|none||none|
|
||
|»»» v1-5-pruned-emaonly.safetensors2|[string]|true|none||none|
|
||
|» message|string|true|none||none|
|
||
|
||
<a id="opIdListCheckpoints"></a>
|
||
|
||
|
||
## DELETE 模型ファイルの削除 DeleteCheckpoints
|
||
|
||
DELETE /checkpoints
|
||
|
||
モデルファイルの削除
|
||
Delete checkpoints
|
||
|
||
> リクエストボディ
|
||
|
||
```
|
||
{
|
||
"checkpoint_id_list": [
|
||
"string"
|
||
]
|
||
}
|
||
```
|
||
|
||
### パラメータ
|
||
|
||
|名称|場所|型|必須|説明|
|
||
|---|---|---|---|---|
|
||
|Authorization|ヘッダ|文字列| はい |なし|
|
||
|body|ボディ|オブジェクト| いいえ |なし|
|
||
|» checkpoint_id_list|ボディ|[文字列]| はい |モデルファイル ID のリスト|
|
||
|
||
> レスポンスの例
|
||
|
||
> 204 レスポンス
|
||
|
||
```
|
||
{}
|
||
```
|
||
|
||
### レスポンス
|
||
|
||
|HTTP ステータスコード |意味|説明|データスキーマ|
|
||
|---|---|---|---|
|
||
|204|[No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5)|No Content|インラインの|
|
||
|
||
### レスポンスデータスキーマ
|
||
|
||
<a id="opIdUpdateCheckpoint"></a>
|
||
|
||
## PUT モデルファイルの状態の更新 UpdateCheckpoint
|
||
|
||
PUT /checkpoints/{id}
|
||
|
||
モデルファイルの状態の更新
|
||
Update Checkpoint
|
||
|
||
> リクエストボディ
|
||
|
||
```
|
||
{
|
||
"status": "Active",
|
||
"multi_parts_tags": {
|
||
"v1-5-pruned-emaonly.safetensors": [
|
||
{
|
||
"ETag": "\"e6279f0ad8bf8048c0d106095c4d4b24\"",
|
||
"PartNumber": 1
|
||
},
|
||
{
|
||
"ETag": "\"01a458e7d019140cb792b577596b7918\"",
|
||
"PartNumber": 2
|
||
},
|
||
{
|
||
"ETag": "\"296e59a1fb1ea02f6512c5b4c4565bea\"",
|
||
"PartNumber": 3
|
||
},
|
||
{
|
||
"ETag": "\"9dd22961ddf32130a22b36dc53f93fd0\"",
|
||
"PartNumber": 4
|
||
},
|
||
{
|
||
"ETag": "\"bfb91caed0e9f1aaaca7a0f125e7e96b\"",
|
||
"PartNumber": 5
|
||
}
|
||
]
|
||
}
|
||
}
|
||
```
|
||
|
||
### パラメータ
|
||
|
||
|名称|場所|型|必須|説明|
|
||
|---|---|---|---|---|
|
||
|id|パス|文字列| はい |なし|
|
||
|body|ボディ|オブジェクト| いいえ |なし|
|
||
|» status|ボディ|文字列| はい |ステータス|
|
||
|» multi_parts_tags|ボディ|オブジェクト| はい |ETags|
|
||
|»» v1-5-pruned-emaonly.safetensors|ボディ|[オブジェクト]| はい |なし|
|
||
|»»» ETag|ボディ|文字列| はい |なし|
|
||
|»»» PartNumber|ボディ|整数| はい |なし|
|
||
|
||
> レスポンスの例
|
||
|
||
> 成功
|
||
|
||
```
|
||
{
|
||
"statusCode": 200,
|
||
"headers": {
|
||
"Access-Control-Allow-Headers": "Content-Type",
|
||
"Access-Control-Allow-Origin": "*",
|
||
"Access-Control-Allow-Methods": "OPTIONS,POST,GET"
|
||
},
|
||
"checkpoint": {
|
||
"id": "d613760c-c8f7-466a-9838-cea3033bf57d",
|
||
"type": "Stable-diffusion",
|
||
"s3_location": "s3://******/Stable-diffusion/checkpoint/custom/d613760c-c8f7-466a-9838-cea3033bf57d",
|
||
"status": "Initial",
|
||
"params": {
|
||
"creator": "admin",
|
||
"multipart_upload": {
|
||
"v1-5-pruned-emaonly.safetensors": {
|
||
"bucket": "******",
|
||
"upload_id": "KFzbB7FwAuCDkR3NRaAO81uNM6E38KrvbB9m9T2dPlE0XUbOXrDB0c9CbhpLA3wFqnN6uTf0qh7HOYOmSXFwicHYOL7XfPMAhsT0cbxRhWvbyKPo8bO_wXrFcbUMDY.ef4vFZNKfdKaRba23Src44CrwGtYjkp3RQ8dEZubjleVTTTz0gaclwjfxmrdpqcZa",
|
||
"key": "Stable-diffusion/checkpoint/custom/d613760c-c8f7-466a-9838-cea3033bf57d/v1-5-pruned-emaonly.safetensors"
|
||
}
|
||
},
|
||
"message": "api-test-message",
|
||
"created": "2023-12-07 00:45:59.334826"
|
||
}
|
||
}
|
||
}
|
||
```
|
||
|
||
### レスポンス
|
||
|
||
|HTTP ステータスコード |意味|説明|データスキーマ|
|
||
|---|---|---|---|
|
||
|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|成功|インラインの|
|
||
|
||
### レスポンスデータスキーマ
|
||
|
||
HTTP ステータスコード **200**
|
||
|
||
|名称|型|必須|制限|タイトル|説明|
|
||
|---|---|---|---|---|---|
|
||
|» statusCode|整数|true|なし||ステータスコード|
|
||
|» headers|オブジェクト|true|なし||なし|
|
||
|»» Access-Control-Allow-Headers|文字列|true|なし||なし|
|
||
|»» Access-Control-Allow-Origin|文字列|true|なし||なし|
|
||
|»» Access-Control-Allow-Methods|文字列|true|なし||なし|
|
||
|» checkpoint|オブジェクト|true|なし||チェックポイント|
|
||
|»» id|文字列|true|なし||ID|
|
||
|»» type|文字列|true|なし||タイプ|
|
||
|»» s3_location|文字列|true|なし||S3 Key|
|
||
|»» status|文字列|true|なし||ステータス|
|
||
|»» params|オブジェクト|true|なし||なし|
|
||
|»»» creator|文字列|true|なし||ユーザー名|
|
||
|»»» multipart_upload|オブジェクト|true|なし||S3 Multipart Upload|
|
||
|»»»» v1-5-pruned-emaonly.safetensors|オブジェクト|true|なし||なし|
|
||
|»»»»» bucket|文字列|true|なし||なし|
|
||
|»»»»» upload_id|文字列|true|なし||なし|
|
||
|»»»»» key|文字列|true|なし||なし|
|
||
|»»» message|文字列|true|なし||メッセージ|
|
||
|»»» created|文字列|true|なし||作成日時|
|
||
|
||
# 推論エンドポイント(Endpoints)
|
||
|
||
<a id="opIdListEndpoints"></a>
|
||
|
||
## GET エンドポイントの一覧を取得 ListEndpoints
|
||
|
||
GET /endpoints
|
||
|
||
推論エンドポイントの一覧を取得
|
||
List inference endpoints
|
||
|
||
### パラメータ
|
||
|
||
|名称|場所|型|必須|説明|
|
||
|---|---|---|---|---|
|
||
|Authorization|ヘッダ|文字列| はい |なし|
|
||
|
||
> レスポンスの例
|
||
|
||
> 成功
|
||
|
||
```
|
||
{
|
||
"statusCode": 200,
|
||
"data": {
|
||
"endpoints": [
|
||
{
|
||
"EndpointDeploymentJobId": "d1253aa5-c884-4989-a7d1-d8806bc4fa59",
|
||
"autoscaling": false,
|
||
"max_instance_number": "1",
|
||
"startTime": "2024-01-30 07:59:46.842717",
|
||
"status": null,
|
||
"instance_type": "ml.g4dn.2xlarge",
|
||
"current_instance_count": "1",
|
||
"endTime": "2024-01-30 08:03:33.991793",
|
||
"endpoint_status": "InService",
|
||
"endpoint_name": "esd-real-time-api-test",
|
||
"error": null,
|
||
"endpoint_type": "Real-time",
|
||
"owner_group_or_role": [
|
||
"byoc"
|
||
]
|
||
},
|
||
{
|
||
"EndpointDeploymentJobId": "a50ba02e-057f-433d-83be-0f52fdd45b13",
|
||
"autoscaling": true,
|
||
"max_instance_number": "1",
|
||
"startTime": "2024-01-26 08:19:52.759748",
|
||
"status": null,
|
||
"instance_type": "ml.g4dn.xlarge",
|
||
"current_instance_count": "0",
|
||
"endTime": "2024-02-02 03:58:32.946464",
|
||
"endpoint_status": "InService",
|
||
"endpoint_name": "esd-async-api-test",
|
||
"error": null,
|
||
"endpoint_type": "Async",
|
||
"owner_group_or_role": [
|
||
"IT Operator"
|
||
]
|
||
}
|
||
]
|
||
},
|
||
"message": "OK"
|
||
}
|
||
```
|
||
|
||
### レスポンス
|
||
|
||
|HTTP ステータスコード |意味|説明|データスキーマ|
|
||
|---|---|---|---|
|
||
|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|成功|インラインの|
|
||
|
||
### レスポンスデータスキーマ
|
||
|
||
HTTP ステータスコード **200**
|
||
|
||
|名称|型|必須|制限|タイトル|説明|
|
||
|---|---|---|---|---|---|
|
||
|» statusCode|整数|true|なし||なし|
|
||
|» data|オブジェクト|true|なし||なし|
|
||
|»» endpoints|[オブジェクト]|true|なし||なし|
|
||
|»»» EndpointDeploymentJobId|文字列|true|なし||なし|
|
||
|»»» autoscaling|ブール値|true|なし||なし|
|
||
|»»» max_instance_number|文字列|true|なし||なし|
|
||
|»»» startTime|文字列|true|なし||なし|
|
||
|»»» status|null|true|なし||なし|
|
||
|»»» instance_type|文字列|true|なし||なし|
|
||
|»»» current_instance_count|文字列|true|なし||なし|
|
||
|»»» endTime|文字列|true|なし||なし|
|
||
|»»» endpoint_status|文字列|true|なし||なし|
|
||
|»»» endpoint_name|文字列|true|なし||なし|
|
||
|»»» error|null|true|なし||なし|
|
||
|»»» endpoint_type|文字列|true|なし||なし|
|
||
|»»» owner_group_or_role|[文字列]|true|なし||なし|
|
||
|» message|文字列|true|なし||なし|
|
||
|
||
<a id="opIdCreateEndpoint"></a>
|
||
|
||
## POST エンドポイントの作成 CreateEndpoint
|
||
|
||
POST /endpoints
|
||
|
||
推論エンドポイントの作成
|
||
Create Endpoint
|
||
|
||
> リクエストボディ
|
||
|
||
```
|
||
{
|
||
"endpoint_name": "test",
|
||
"endpoint_type": "Async",
|
||
"instance_type": "ml.g5.2xlarge",
|
||
"initial_instance_count": "1",
|
||
"autoscaling_enabled": false,
|
||
"assign_to_roles": [
|
||
"IT Operator"
|
||
],
|
||
"creator": "admin"
|
||
}
|
||
```
|
||
|
||
### パラメータ
|
||
|
||
|名称|場所|型|必須|説明|
|
||
|---|---|---|---|---|
|
||
|Authorization|ヘッダ|文字列| はい |なし|
|
||
|body|ボディ|オブジェクト| いいえ |なし|
|
||
|» endpoint_name|ボディ|文字列| いいえ |エンドポイント名|
|
||
|» endpoint_type|ボディ|文字列| はい |エンドポイントタイプ|
|
||
|» instance_type|ボディ|文字列| はい |インスタンスタイプ|
|
||
|» initial_instance_count|ボディ|文字列| はい |初期インスタンス数|
|
||
|» autoscaling_enabled|ボディ|ブール値| はい |オートスケーリングを有効にする|
|
||
|» assign_to_roles|ボディ|[文字列]| はい |ロールのリスト|
|
||
|» creator|ボディ|文字列| はい |作成者ユーザー名|
|
||
|
||
> レスポンスの例
|
||
|
||
> 成功
|
||
|
||
```
|
||
{
|
||
"statusCode": 200,
|
||
"message": "Endpoint deployment started: infer-endpoint-prod",
|
||
"data": {
|
||
"EndpointDeploymentJobId": "60b12a2e-c54d-496c-b405-1bc77b17e2f9",
|
||
"autoscaling": false,
|
||
"max_instance_number": "1",
|
||
"startTime": "2023-12-07 01:08:43.410628",
|
||
"status": null,
|
||
"current_instance_count": "0",
|
||
"endTime": null,
|
||
"endpoint_status": "Creating",
|
||
"endpoint_name": "infer-endpoint-prod",
|
||
"error": null,
|
||
"owner_group_or_role": [
|
||
"IT Operator"
|
||
]
|
||
}
|
||
}
|
||
```
|
||
|
||
### レスポンス
|
||
|
||
|HTTP ステータスコード |意味|説明|データスキーマ|
|
||
|---|---|---|---|
|
||
|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|成功|インラインの|
|
||
|
||
### レスポンスデータスキーマ
|
||
|
||
HTTP ステータスコード **200**
|
||
|
||
|名称|型|必須|制限|タイトル|説明|
|
||
|---|---|---|---|---|---|
|
||
|» statusCode|整数|true|なし||なし|
|
||
|» message|文字列|true|なし||なし|
|
||
|» data|[Endpoint](#schemaendpoint)|true|なし||なし|
|
||
|»» EndpointDeploymentJobId|文字列|true|なし||ID|
|
||
|»» autoscaling|ブール値|true|なし||オートスケーリング有効|
|
||
|»» max_instance_number|文字列|true|なし||最大インスタンス数|
|
||
|»» startTime|文字列|true|なし||開始時刻|
|
||
|»» current_instance_count|整数|true|なし||現在のインスタンス数|
|
||
|»» endTime|文字列|true|なし||終了時刻|
|
||
|»» endpoint_status|文字列|true|なし||エンドポイントステータス|
|
||
|»» endpoint_name|文字列|true|なし||エンドポイント名|
|
||
|»» error|null|true|なし||エラーメッセージ|
|
||
|»» owner_group_or_role|[文字列]|true|なし||ロール|
|
||
|
||
<a id="opIdDeleteEndpoints"></a>
|
||
|
||
## DELETE エンドポイントの削除 DeleteEndpoints
|
||
|
||
DELETE /endpoints
|
||
|
||
推論エンドポイントの削除
|
||
Delete endpoints
|
||
|
||
> リクエストボディ
|
||
|
||
```
|
||
{
|
||
"delete_endpoint_list": [
|
||
"infer-endpoint-test"
|
||
],
|
||
"username": "admin"
|
||
}
|
||
```
|
||
|
||
### パラメータ
|
||
|
||
|名称|場所|型|必須|説明|
|
||
|---|---|---|---|---|
|
||
|Authorization|ヘッダ|文字列| はい |なし|
|
||
|body|ボディ|オブジェクト| いいえ |なし|
|
||
|» delete_endpoint_list|ボディ|[文字列]| はい |エンドポイント名のリスト|
|
||
|» username|ボディ|文字列| はい |ユーザー名|
|
||
|
||
> レスポンスの例
|
||
|
||
> 200 レスポンス
|
||
|
||
```
|
||
{}
|
||
```
|
||
|
||
### レスポンス
|
||
|
||
|HTTP ステータスコード |意味|説明|データスキーマ|
|
||
|---|---|---|---|
|
||
|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|成功|インラインの|
|
||
|
||
### レスポンスデータスキーマ
|
||
|
||
# 推論(Inferences)
|
||
|
||
<a id="opIdCreateInferenceJob"></a>
|
||
|
||
## POST 推論ジョブの作成 CreateInferenceJob
|
||
|
||
POST /inferences
|
||
|
||
推論ジョブの作成。レスポンスを受け取った後、`api_params_s3_upload_url` にペイロードをアップロードする必要があります。
|
||
Create inference, When you got response, you have to upload your Payload to `api_params_s3_upload_url`
|
||
|
||
> リクエストボディ
|
||
|
||
```
|
||
{
|
||
"user_id": "admin",
|
||
"inference_type": "Async",
|
||
"task_type": "txt2img",
|
||
"models": {
|
||
"Stable-diffusion": [
|
||
"v1-5-pruned-emaonly.safetensors"
|
||
],
|
||
"VAE": [
|
||
"Automatic"
|
||
],
|
||
"embeddings": []
|
||
},
|
||
"filters": {
|
||
"createAt": 1707141090.135923,
|
||
"creator": "sd-webui"
|
||
}
|
||
}
|
||
```
|
||
|
||
### パラメータ
|
||
|
||
|名称|場所|型|必須|説明|
|
||
|---|---|---|---|---|
|
||
|body|ボディ|オブジェクト| いいえ |なし|
|
||
|» user_id|ボディ|文字列| はい |ユーザー名|
|
||
|» inference_type|ボディ|文字列| はい |推論タイプ Async | Real-time|
|
||
|» task_type|ボディ|文字列| はい |タスクタイプ txt2img | img2img | rembg|
|
||
|» models|ボディ|オブジェクト| はい |モデルのリスト|
|
||
|»» Stable-diffusion|ボディ|[文字列]| はい |なし|
|
||
|»» VAE|ボディ|[文字列]| はい |なし|
|
||
|»» embeddings|ボディ|[文字列]| はい |なし|
|
||
|» filters|ボディ|オブジェクト| はい |次のバージョンで削除予定|
|
||
|»» createAt|ボディ|数値| はい |なし|
|
||
|»» creator|ボディ|文字列| はい |なし|
|
||
|
||
> レスポンスの例
|
||
|
||
> 成功
|
||
|
||
```
|
||
{
|
||
"statusCode": 201,
|
||
"data": {
|
||
"inference": {
|
||
"id": "f3421ce5-9ab9-40a2-b33b-3f126de70a52",
|
||
"type": "txt2img",
|
||
"api_params_s3_location": "s3://xxxx/txt2img/infer_v2/f3421ce5-9ab9-40a2-b33b-3f126de70a52/api_param.json",
|
||
"api_params_s3_upload_url": "...",
|
||
"models": [
|
||
{
|
||
"id": "32a7af23-3763-4289-a6af-2156a2331878",
|
||
"name": [
|
||
"v1-5-pruned-emaonly.safetensors"
|
||
],
|
||
"type": "Stable-diffusion"
|
||
},
|
||
{
|
||
"id": "VAE",
|
||
"name": [
|
||
"Automatic"
|
||
],
|
||
"type": "VAE"
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"message": "Created"
|
||
}
|
||
```
|
||
|
||
### レスポンス
|
||
|
||
|HTTP ステータスコード |意味|説明|データスキーマ|
|
||
|---|---|---|---|
|
||
|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|成功|インラインの|
|
||
|
||
### レスポンスデータスキーマ
|
||
|
||
HTTP ステータスコード **200**
|
||
|
||
|名称|型|必須|制限|タイトル|説明|
|
||
|---|---|---|---|---|---|
|
||
|» statusCode|整数|true|なし||なし|
|
||
|» data|オブジェクト|true|なし||なし|
|
||
|»» inference|オブジェクト|true|なし||なし|
|
||
|»»» id|文字列|true|なし||なし|
|
||
|»»» type|文字列|true|なし||なし|
|
||
|»»» api_params_s3_location|文字列|true|なし||なし|
|
||
|»»» api_params_s3_upload_url|文字列|true|なし||なし|
|
||
|»»» models|[オブジェクト]|true|なし||なし|
|
||
|»»»» id|文字列|true|なし||なし|
|
||
|»»»» name|[文字列]|true|なし||なし|
|
||
|»»»» type|文字列|true|なし||なし|
|
||
|» message|文字列|true|なし||なし|
|
||
|
||
<a id="opIdListInferenceJobs"></a>
|
||
|
||
|
||
## DELETE 推理作業の削除 DeleteInferenceJobs
|
||
|
||
DELETE /inferences
|
||
|
||
推理作業のリストを削除します
|
||
推理作業を削除します
|
||
|
||
> リクエストボディパラメーター
|
||
|
||
```
|
||
{
|
||
"inference_id_list": [
|
||
"99"
|
||
]
|
||
}
|
||
```
|
||
|
||
### パラメーター
|
||
|
||
|名前|場所|型|必須|説明|
|
||
|---|---|---|---|---|
|
||
|Authorization|ヘッダー|文字列|いいえ|なし|
|
||
|body|ボディ|オブジェクト|いいえ|なし|
|
||
|» inference_id_list|ボディ|[文字列]|はい|推理作業 ID リスト|
|
||
|
||
> レスポンス例
|
||
|
||
> 空のレスポンス
|
||
|
||
```
|
||
{}
|
||
```
|
||
|
||
### レスポンス
|
||
|
||
|HTTP ステータスコード|意味|説明|データスキーマ|
|
||
|---|---|---|---|
|
||
|204|[No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5)|空のレスポンス|インライン|
|
||
|
||
### レスポンスデータスキーマ
|
||
|
||
<a id="opIdRunInferenceJob"></a>
|
||
|
||
## PUT 推理作業の開始 StartInferenceJob
|
||
|
||
PUT /inferences/{jobId}/start
|
||
|
||
推理作業を開始します
|
||
推理作業を開始します
|
||
|
||
### パラメーター
|
||
|
||
|名前|場所|型|必須|説明|
|
||
|---|---|---|---|---|
|
||
|jobId|パス|文字列|はい|推理作業 ID|
|
||
|Authorization|ヘッダー|文字列|はい|なし|
|
||
|
||
> レスポンス例
|
||
|
||
> 成功
|
||
|
||
```
|
||
{
|
||
"statusCode": 202,
|
||
"data": {
|
||
"inference": {
|
||
"inference_id": "f3421ce5-9ab9-40a2-b33b-3f126de70a52",
|
||
"status": "inprogress",
|
||
"endpoint_name": "esd-async-97fce5e",
|
||
"output_path": "s3://xxxx/sagemaker_output/48159016-c040-4b49-8a1c-b57445946918.out"
|
||
}
|
||
},
|
||
"message": "Accepted"
|
||
}
|
||
```
|
||
|
||
### レスポンス
|
||
|
||
|HTTP ステータスコード|意味|説明|データスキーマ|
|
||
|---|---|---|---|
|
||
|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|成功|インライン|
|
||
|
||
### レスポンスデータスキーマ
|
||
|
||
HTTP ステータスコード **200**
|
||
|
||
|名前|型|必須|制限|タイトル|説明|
|
||
|---|---|---|---|---|---|
|
||
|» statusCode|整数|true|なし||なし|
|
||
|» data|オブジェクト|true|なし||なし|
|
||
|»» inference|オブジェクト|true|なし||なし|
|
||
|»»» inference_id|文字列|true|なし||なし|
|
||
|»»» status|文字列|true|なし||なし|
|
||
|»»» endpoint_name|文字列|true|なし||なし|
|
||
|»»» output_path|文字列|true|なし||なし|
|
||
|» message|文字列|true|なし||なし|
|
||
|
||
<a id="opIdGetInferenceJob"></a>
|
||
|
||
## GET 推理作業の詳細の取得 GetInferenceJob
|
||
|
||
GET /inferences/{jobId}
|
||
|
||
指定の推理作業の詳細を取得します
|
||
特定の推理作業の詳細を取得します
|
||
|
||
### パラメーター
|
||
|
||
|名前|場所|型|必須|説明|
|
||
|---|---|---|---|---|
|
||
|jobId|パス|文字列|はい|推理作業 ID|
|
||
|Authorization|ヘッダー|文字列|はい|なし|
|
||
|
||
> レスポンス例
|
||
|
||
> 成功
|
||
|
||
```
|
||
{
|
||
"statusCode": 200,
|
||
"data": {
|
||
"img_presigned_urls": [
|
||
"..."
|
||
],
|
||
"output_presigned_urls": [
|
||
"..."
|
||
],
|
||
"startTime": "2024-02-05 06:10:52.552528",
|
||
"taskType": "txt2img",
|
||
"completeTime": "2024-02-05 06:10:56.270528",
|
||
"params": {
|
||
"input_body_presign_url": "...",
|
||
"used_models": {
|
||
"Stable-diffusion": [
|
||
{
|
||
"s3": "s3://xxxx/Stable-diffusion/checkpoint/custom/32a7af23-3763-4289-a6af-2156a2331878",
|
||
"id": "32a7af23-3763-4289-a6af-2156a2331878",
|
||
"model_name": "v1-5-pruned-emaonly.safetensors",
|
||
"type": "Stable-diffusion"
|
||
}
|
||
],
|
||
"VAE": [
|
||
{
|
||
"s3": "None",
|
||
"id": "VAE",
|
||
"model_name": "Automatic",
|
||
"type": "VAE"
|
||
}
|
||
]
|
||
},
|
||
"input_body_s3": "s3://xxxx/txt2img/infer_v2/9d93e241-745a-4464-bb99-22253c910a01/api_param.json",
|
||
"sagemaker_inference_instance_type": "ml.g4dn.2xlarge",
|
||
"sagemaker_inference_endpoint_id": "9ef3c8bf-936e-47bb-a6da-e11e43140fb1",
|
||
"sagemaker_inference_endpoint_name": "esd-real-time-9ef3c8b"
|
||
},
|
||
"InferenceJobId": "9d93e241-745a-4464-bb99-22253c910a01",
|
||
"status": "succeed",
|
||
"inference_type": "Real-time",
|
||
"createTime": "2024-02-05 06:10:52.299624",
|
||
"image_names": [
|
||
"image_0.png"
|
||
],
|
||
"owner_group_or_role": [
|
||
"admin"
|
||
]
|
||
},
|
||
"message": "OK"
|
||
}
|
||
```
|
||
|
||
### レスポンス
|
||
|
||
|HTTP ステータスコード|意味|説明|データスキーマ|
|
||
|---|---|---|---|
|
||
|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|成功|インライン|
|
||
|
||
### レスポンスデータスキーマ
|
||
|
||
HTTP ステータスコード **200**
|
||
|
||
|名前|型|必須|制限|タイトル|説明|
|
||
|---|---|---|---|---|---|
|
||
|» statusCode|整数|true|なし||なし|
|
||
|» data|オブジェクト|true|なし||なし|
|
||
|»» img_presigned_urls|[文字列]|true|なし||なし|
|
||
|»» output_presigned_urls|[文字列]|true|なし||なし|
|
||
|»» startTime|文字列|true|なし||なし|
|
||
|»» taskType|文字列|true|なし||なし|
|
||
|»» completeTime|文字列|true|なし||なし|
|
||
|»» params|オブジェクト|true|なし||なし|
|
||
|»»» input_body_presign_url|文字列|true|なし||なし|
|
||
|»»» used_models|オブジェクト|true|なし||なし|
|
||
|»»»» Stable-diffusion|[オブジェクト]|true|なし||なし|
|
||
|»»»»» s3|文字列|false|なし||なし|
|
||
|»»»»» id|文字列|false|なし||なし|
|
||
|»»»»» model_name|文字列|false|なし||なし|
|
||
|»»»»» type|文字列|false|なし||なし|
|
||
|»»»» VAE|[オブジェクト]|true|なし||なし|
|
||
|»»»»» s3|文字列|false|なし||なし|
|
||
|»»»»» id|文字列|false|なし||なし|
|
||
|»»»»» model_name|文字列|false|なし||なし|
|
||
|»»»»» type|文字列|false|なし||なし|
|
||
|»»» input_body_s3|文字列|true|なし||なし|
|
||
|»»» sagemaker_inference_instance_type|文字列|true|なし||なし|
|
||
|»»» sagemaker_inference_endpoint_id|文字列|true|なし||なし|
|
||
|»»» sagemaker_inference_endpoint_name|文字列|true|なし||なし|
|
||
|»» InferenceJobId|文字列|true|なし||なし|
|
||
|»» status|文字列|true|なし||なし|
|
||
|»» inference_type|文字列|true|なし||なし|
|
||
|»» createTime|文字列|true|なし||なし|
|
||
|»» image_names|[文字列]|true|なし||なし|
|
||
|»» owner_group_or_role|[文字列]|true|なし||なし|
|
||
|» message|文字列|true|なし||なし|
|
||
|
||
# データスキーマ
|
||
|
||
<h2 id="tocS_Checkpoint">Checkpoint</h2>
|
||
|
||
<a id="schemacheckpoint"></a>
|
||
<a id="schema_Checkpoint"></a>
|
||
<a id="tocScheckpoint"></a>
|
||
<a id="tocscheckpoint"></a>
|
||
|
||
```
|
||
{
|
||
"id": "string",
|
||
"s3Location": "string",
|
||
"type": "string",
|
||
"status": "string",
|
||
"name": [
|
||
"string"
|
||
],
|
||
"created": 0,
|
||
"allowed_roles_or_users": [
|
||
"string"
|
||
]
|
||
}
|
||
|
||
```
|
||
|
||
### 属性
|
||
|
||
|名前|型|必須|制限|タイトル|説明|
|
||
|---|---|---|---|---|---|
|
||
|id|文字列|true|なし||なし|
|
||
|s3Location|文字列|true|なし||なし|
|
||
|type|文字列|true|なし||なし|
|
||
|status|文字列|true|なし||なし|
|
||
|name|[文字列]|true|なし||なし|
|
||
|created|数値|true|なし||なし|
|
||
|allowed_roles_or_users|[文字列]|true|なし||なし|
|
||
|
||
<h2 id="tocS_Endpoint">Endpoint</h2>
|
||
|
||
<a id="schemaendpoint"></a>
|
||
<a id="schema_Endpoint"></a>
|
||
<a id="tocSendpoint"></a>
|
||
<a id="tocsendpoint"></a>
|
||
|
||
```
|
||
{
|
||
"EndpointDeploymentJobId": "string",
|
||
"autoscaling": true,
|
||
"max_instance_number": "string",
|
||
"startTime": "string",
|
||
"current_instance_count": 0,
|
||
"endTime": "string",
|
||
"endpoint_status": "string",
|
||
"endpoint_name": "string",
|
||
"error": null,
|
||
"owner_group_or_role": [
|
||
"string"
|
||
]
|
||
}
|
||
|
||
```
|
||
|
||
### 属性
|
||
|
||
|名前|型|必須|制限|タイトル|説明|
|
||
|---|---|---|---|---|---|
|
||
|EndpointDeploymentJobId|文字列|true|なし||ID|
|
||
|autoscaling|ブール値|true|なし||自動スケーリング有効|
|
||
|max_instance_number|文字列|true|なし||最大インスタンス数|
|
||
|startTime|文字列|true|なし||開始時間|
|
||
|current_instance_count|整数|true|なし||現在のインスタンス数|
|
||
|endTime|文字列|true|なし||終了時間|
|
||
|endpoint_status|文字列|true|なし||エンドポイントステータス|
|
||
|endpoint_name|文字列|true|なし||エンドポイント名|
|
||
|error|null|true|なし||エラーメッセージ|
|
||
|owner_group_or_role|[文字列]|true|なし||ロール|
|
||
|
||
<h2 id="tocS_User">User</h2>
|
||
|
||
<a id="schemauser"></a>
|
||
<a id="schema_User"></a>
|
||
<a id="tocSuser"></a>
|
||
<a id="tocsuser"></a>
|
||
|
||
```
|
||
{
|
||
"username": "string",
|
||
"roles": [
|
||
"string"
|
||
],
|
||
"creator": "string",
|
||
"permissions": [
|
||
"string"
|
||
],
|
||
"password": "string"
|
||
}
|
||
|
||
```
|
||
|
||
### 属性
|
||
|
||
|名前|型|必須|制限|タイトル|説明|
|
||
|---|---|---|---|---|---|
|
||
|username|文字列|true|なし||ユーザー名|
|
||
|roles|[文字列]|true|なし||ロールリスト|
|
||
|creator|文字列|true|なし||作成者ユーザー名|
|
||
|permissions|[文字列]|true|なし||権限リスト|
|
||
|password|文字列|true|なし||パスワード|
|
||
|
||
<h2 id="tocS_InferenceJob">InferenceJob</h2>
|
||
|
||
<a id="schemainferencejob"></a>
|
||
<a id="schema_InferenceJob"></a>
|
||
<a id="tocSinferencejob"></a>
|
||
<a id="tocsinferencejob"></a>
|
||
|
||
```
|
||
{
|
||
"startTime": "string",
|
||
"taskType": "string",
|
||
"completeTime": "string",
|
||
"params": {
|
||
"input_body_presign_url": "string",
|
||
"used_models": {
|
||
"Stable-diffusion": [
|
||
{
|
||
"s3": "string",
|
||
"id": "string",
|
||
"model_name": "string",
|
||
"type": "string"
|
||
}
|
||
],
|
||
"Lora": [
|
||
{
|
||
"s3": "string",
|
||
"id": "string",
|
||
"model_name": "string",
|
||
"type": "string"
|
||
}
|
||
]
|
||
},
|
||
"input_body_s3": "string",
|
||
"output_path": "string",
|
||
"sagemaker_inference_endpoint_id": "string",
|
||
"sagemaker_inference_endpoint_name": "string"
|
||
},
|
||
"InferenceJobId": "string",
|
||
"status": "string",
|
||
"sagemakerRaw": "string",
|
||
"image_names": [
|
||
"string"
|
||
],
|
||
"owner_group_or_role": [
|
||
"string"
|
||
]
|
||
}
|
||
|
||
```
|
||
|
||
### 属性
|
||
|
||
|名前|型|必須|制限|タイトル|説明|
|
||
|---|---|---|---|---|---|
|
||
|startTime|文字列|true|なし||開始時間|
|
||
|taskType|文字列|true|なし||タスクタイプ|
|
||
|completeTime|文字列|true|なし||完了時間|
|
||
|params|オブジェクト|true|なし||パラメーター|
|
||
|» input_body_presign_url|文字列|true|なし||なし|
|
||
|» used_models|オブジェクト|true|なし||なし|
|
||
|»» Stable-diffusion|[オブジェクト]|true|なし||なし|
|
||
|»»» s3|文字列|false|なし||なし|
|
||
|»»» id|文字列|false|なし||なし|
|
||
|»»» model_name|文字列|false|なし||なし|
|
||
|»»» type|文字列|false|なし||なし|
|
||
|»» Lora|[オブジェクト]|true|なし||なし|
|
||
|»»» s3|文字列|false|なし||なし|
|
||
|»»» id|文字列|false|なし||なし|
|
||
|»»» model_name|文字列|false|なし||なし|
|
||
|»»» type|文字列|false|なし||なし|
|
||
|» input_body_s3|文字列|true|なし||なし|
|
||
|» output_path|文字列|true|なし||なし|
|
||
|» sagemaker_inference_endpoint_id|文字列|true|なし||なし|
|
||
|» sagemaker_inference_endpoint_name|文字列|true|なし||なし|
|
||
|InferenceJobId|文字列|true|なし||推理作業 ID|
|
||
|status|文字列|true|なし||ステータス|
|
||
|sagemakerRaw|文字列|true|なし||Sagemaker Raw|
|
||
|image_names|[文字列]|true|なし||画像配列|
|
||
|owner_group_or_role|[文字列]|true|なし||ロール|
|
||
|
||
<h2 id="tocS_Role">Role</h2>
|
||
|
||
<a id="schemarole"></a>
|
||
<a id="schema_Role"></a>
|
||
<a id="tocSrole"></a>
|
||
<a id="tocsrole"></a>
|
||
|
||
```
|
||
{
|
||
"role_name": "string",
|
||
"creator": "string",
|
||
"permissions": [
|
||
"string"
|
||
]
|
||
}
|
||
|
||
```
|
||
|
||
### 属性
|
||
|
||
|名前|型|必須|制限|タイトル|説明|
|
||
|---|---|---|---|---|---|
|
||
|role_name|文字列|true|なし||ロール名|
|
||
|creator|文字列|true|なし||作成者ユーザー名|
|
||
|permissions|[文字列]|true|なし||権限リスト|
|
||
|