From 243e04f034968f2b895dec74248eb108aa3aaaf0 Mon Sep 17 00:00:00 2001 From: Jingyi Date: Mon, 24 Jun 2024 16:14:05 +0800 Subject: [PATCH] improved oas --- .github/workflows/gh-pages.yml | 9 +- .gitignore | 1 + .viperlightignore | 2 +- buildspec.yml | 5 +- docs/en/developer-guide/api.md | 3 + docs/en/developer-guide/api/1.4.0.md | 1350 ------------------------- docs/en/developer-guide/api/1.6.0.md | 3 - docs/ja/developer-guide/api.md | 3 + docs/ja/developer-guide/api/1.4.0.md | 1352 -------------------------- docs/ja/developer-guide/api/1.6.0.md | 3 - docs/mkdocs.en.yml | 3 +- docs/mkdocs.ja.yml | 3 +- docs/mkdocs.zh.yml | 3 +- docs/zh/developer-guide/api.md | 3 + docs/zh/developer-guide/api/1.4.0.md | 1350 ------------------------- docs/zh/developer-guide/api/1.6.0.md | 3 - 16 files changed, 19 insertions(+), 4077 deletions(-) create mode 100644 docs/en/developer-guide/api.md delete mode 100644 docs/en/developer-guide/api/1.4.0.md delete mode 100644 docs/en/developer-guide/api/1.6.0.md create mode 100644 docs/ja/developer-guide/api.md delete mode 100644 docs/ja/developer-guide/api/1.4.0.md delete mode 100644 docs/ja/developer-guide/api/1.6.0.md create mode 100644 docs/zh/developer-guide/api.md delete mode 100644 docs/zh/developer-guide/api/1.4.0.md delete mode 100644 docs/zh/developer-guide/api/1.6.0.md diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 0a1c373f..b4d7a1c8 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -33,12 +33,9 @@ jobs: - name: Build mkdocs run: | export OAS_FILE=https://aws-gcr-solutions.s3.amazonaws.com/extension-for-stable-diffusion-on-aws/oas.json - mkdir -p ./docs/zh/developer-guide/api/ - wget -qO ./docs/zh/developer-guide/api/esd-oas.json $OAS_FILE - mkdir -p ./docs/jp/developer-guide/api/ - wget -qO ./docs/jp/developer-guide/api/esd-oas.json $OAS_FILE - mkdir -p ./docs/en/developer-guide/api/ - wget -qO ./docs/en/developer-guide/api/esd-oas.json $OAS_FILE + wget -qO ./docs/zh/developer-guide/oas.json $OAS_FILE + wget -qO ./docs/jp/developer-guide/oas.json $OAS_FILE + wget -qO ./docs/en/developer-guide/oas.json $OAS_FILE mkdocs build -f ./docs/mkdocs.en.yml mkdocs build -f ./docs/mkdocs.zh.yml mkdocs build -f ./docs/mkdocs.ja.yml diff --git a/.gitignore b/.gitignore index 7ada5763..0ce78dd6 100644 --- a/.gitignore +++ b/.gitignore @@ -51,3 +51,4 @@ test/**/.env /container/ /.env supervisord.* +oas.json diff --git a/.viperlightignore b/.viperlightignore index 9ce91fd4..431485b2 100644 --- a/.viperlightignore +++ b/.viperlightignore @@ -6,6 +6,6 @@ README.md .github/workflows/ infrastructure/.github/workflows/ infrastructure/src/main.ts -docs/zh/developer-guide/api/esd-oas.json +docs/zh/developer-guide/api/oas.json middleware_api/service/oas.py test/buildspec_build.sh diff --git a/buildspec.yml b/buildspec.yml index 68f8f672..939594f7 100644 --- a/buildspec.yml +++ b/buildspec.yml @@ -68,17 +68,16 @@ phases: - cat ../infrastructure/src/shared/version.ts - sed -i "s/client_api_version = \"[0-9.]*\"/client_api_version = \"$TAG_NUMBER\"/" ../aws_extension/cloud_api_manager/api.py - echo "" + - sed -i "s/sd_dev/sd_$BUILD_VERSION/" ../workshop/ec2.yaml - sed -i "s/ESD_VERSION=dev/ESD_VERSION=$BUILD_VERSION/" ../workshop/ec2.yaml - sed -i "s/WebUiEC2Instance/WebUiEC2Instance${CODEBUILD_RESOLVED_SOURCE_VERSION:0:7}/" ../workshop/ec2.yaml - - sed -i "s/sd_dev/sd_$BUILD_VERSION/" ../workshop/ec2.yaml - - aws s3 cp --region us-east-1 ../workshop/ec2.yaml s3://aws-gcr-solutions-us-east-1/extension-for-stable-diffusion-on-aws/ec2.yaml --content-type text/yaml --acl public-read - aws s3 cp --region us-east-1 ../workshop/ec2.yaml s3://aws-gcr-solutions/extension-for-stable-diffusion-on-aws/sd_dev.yaml --content-type text/yaml --acl public-read - aws s3 cp --region us-east-1 ../workshop/ec2.yaml s3://aws-gcr-solutions/extension-for-stable-diffusion-on-aws/sd_$BUILD_VERSION.yaml --content-type text/yaml --acl public-read - echo "" + - sed -i "s/comfy_dev/comfy_$BUILD_VERSION/" ../workshop/comfy.yaml - sed -i "s/ESD_VERSION=dev/ESD_VERSION=$BUILD_VERSION/" ../workshop/comfy.yaml - sed -i "s/ComfyEC2Dev/ComfyEC2${CODEBUILD_RESOLVED_SOURCE_VERSION:0:7}/" ../workshop/comfy.yaml - sed -i "s/ApiGwResource/ApiGwResource${CODEBUILD_RESOLVED_SOURCE_VERSION:0:7}/" ../workshop/comfy.yaml - - sed -i "s/comfy_dev/comfy_$BUILD_VERSION/" ../workshop/comfy.yaml - aws s3 cp --region us-east-1 ../workshop/comfy.yaml s3://aws-gcr-solutions/extension-for-stable-diffusion-on-aws/comfy_dev.yaml --content-type text/yaml --acl public-read - aws s3 cp --region us-east-1 ../workshop/comfy.yaml s3://aws-gcr-solutions/extension-for-stable-diffusion-on-aws/comfy_$BUILD_VERSION.yaml --content-type text/yaml --acl public-read - echo "" diff --git a/docs/en/developer-guide/api.md b/docs/en/developer-guide/api.md new file mode 100644 index 00000000..b313ecea --- /dev/null +++ b/docs/en/developer-guide/api.md @@ -0,0 +1,3 @@ +# ESD API + +!!swagger oas.json!! diff --git a/docs/en/developer-guide/api/1.4.0.md b/docs/en/developer-guide/api/1.4.0.md deleted file mode 100644 index e7e3b0c0..00000000 --- a/docs/en/developer-guide/api/1.4.0.md +++ /dev/null @@ -1,1350 +0,0 @@ -# ESD 1.4.0 - - -# 健康检查(Ping) - - - -## GET 健康检查 (Ping) - -GET /ping - -测试客户端是否可以连接到 API,并检查配置是否正确。 -Test whether client can connect to api and check the API_TOKEN is correct. - -> Response Examples - -> Success - -```json -{ - "message": "pong", - "statusCode": 200 -} -``` - -### Responses - -|HTTP Status Code |Meaning|Description|Data schema| -|---|---|---|---| -|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Success|Inline| - -### Responses Data Schema - -HTTP Status Code **200** - -|Name|Type|Required|Restrictions|Title|description| -|---|---|---|---|---|---| -|» message|string|true|none||none| -|» statusCode|integer|true|none||none| - -# 角色(Roles) - - - -## DELETE 删除角色 DeleteRoles - -DELETE /roles - -删除角色 -Delete roles - -> Body Parameters - -```json -{ - "role_name_list": [ - "role_name_1" - ] -} -``` - -### Params - -|Name|Location|Type|Required|Description| -|---|---|---|---|---| -|Authorization|header|string| yes |none| -|body|body|object| no |none| -|» role_name_list|body|[string]| yes |角色列表(Role Name List)| - -> Response Examples - -> 204 Response - -```json -{} -``` - -### Responses - -|HTTP Status Code |Meaning|Description|Data schema| -|---|---|---|---| -|204|[No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5)|No Content|Inline| - -### Responses Data Schema - - - -## POST 创建角色 CreateRole - -POST /roles - -创建新角色 -Create a new role - -> Body Parameters - -```json -{ - "role_name": "new_role_name", - "creator": "admin", - "permissions": [ - "train:all", - "checkpoint:all" - ] -} -``` - -### Params - -|Name|Location|Type|Required|Description| -|---|---|---|---|---| -|Authorization|header|string| yes |none| -|body|body|[Role](#schemarole)| no |none| - -> Response Examples - -> Created - -```json -{ - "statusCode": 201, - "message": "role created" -} -``` - -### Responses - -|HTTP Status Code |Meaning|Description|Data schema| -|---|---|---|---| -|201|[Created](https://tools.ietf.org/html/rfc7231#section-6.3.2)|Created|Inline| - -### Responses Data Schema - -HTTP Status Code **201** - -|Name|Type|Required|Restrictions|Title|description| -|---|---|---|---|---|---| -|» statusCode|integer|true|none||none| -|» message|string|true|none||none| - -# 用户(Users) - - - -## GET 获取用户列表 ListUsers - -GET /users - -获取用户列表 -List all users - -### Params - -|Name|Location|Type|Required|Description| -|---|---|---|---|---| -|Authorization|header|string| yes |none| - -> Response Examples - -> Success - -```json -{ - "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 Status Code |Meaning|Description|Data schema| -|---|---|---|---| -|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Success|Inline| - -### Responses Data Schema - -HTTP Status Code **200** - -|Name|Type|Required|Restrictions|Title|description| -|---|---|---|---|---|---| -|» 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| - - - -## POST 创建用户 CreateUser - -POST /users - -创建新用户 -Create a new user - -> Body Parameters - -```json -{ - "username": "username", - "password": "XXXXXXXXXXXXX", - "creator": "admin", - "roles": [ - "IT Operator" - ] -} -``` - -### Params - -|Name|Location|Type|Required|Description| -|---|---|---|---|---| -|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 - -```json -{ - "statusCode": 201, - "message": "Created" -} -``` - -### Responses - -|HTTP Status Code |Meaning|Description|Data schema| -|---|---|---|---| -|201|[Created](https://tools.ietf.org/html/rfc7231#section-6.3.2)|Created|Inline| - -### Responses Data Schema - -HTTP Status Code **201** - -|Name|Type|Required|Restrictions|Title|description| -|---|---|---|---|---|---| -|» statusCode|integer|true|none||none| -|» message|string|true|none||none| - - - -## DELETE 删除用户 DeleteUsers - -DELETE /users - -删除用户 -Delete users - -> Body Parameters - -```json -{ - "user_name_list": [ - "string" - ] -} -``` - -### Params - -|Name|Location|Type|Required|Description| -|---|---|---|---|---| -|Authorization|header|string| yes |none| -|body|body|object| no |none| -|» user_name_list|body|[string]| yes |用户名列表(User Name List)| - -> Response Examples - -> 204 Response - -```json -{} -``` - -### Responses - -|HTTP Status Code |Meaning|Description|Data schema| -|---|---|---|---| -|204|[No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5)|No Content|Inline| - -### Responses Data Schema - -# 模型文件(Checkpoints) - - - -## POST 通过URL上传模型文件 CreateCheckpoint - -POST /checkpoints - -通过URL上传模型文件 -Create a new Checkpoint by URL - -> Body Parameters - -```json -{ - "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 - -|Name|Location|Type|Required|Description| -|---|---|---|---|---| -|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 - -```json -{ - "statusCode": 202, - "message": "Checkpoint creation in progress, please check later" -} -``` - -### Responses - -|HTTP Status Code |Meaning|Description|Data schema| -|---|---|---|---| -|202|[Accepted](https://tools.ietf.org/html/rfc7231#section-6.3.3)|Accepted|Inline| - -### Responses Data Schema - -HTTP Status Code **202** - -|Name|Type|Required|Restrictions|Title|description| -|---|---|---|---|---|---| -|» 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| - - - -## DELETE 删除模型文件 DeleteCheckpoints - -DELETE /checkpoints - -删除模型文件 -Delete checkpoints - -> Body Parameters - -```json -{ - "checkpoint_id_list": [ - "string" - ] -} -``` - -### Params - -|Name|Location|Type|Required|Description| -|---|---|---|---|---| -|Authorization|header|string| yes |none| -|body|body|object| no |none| -|» checkpoint_id_list|body|[string]| yes |模型文件ID列表(ID List)| - -> Response Examples - -> 204 Response - -```json -{} -``` - -### Responses - -|HTTP Status Code |Meaning|Description|Data schema| -|---|---|---|---| -|204|[No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5)|No Content|Inline| - -### Responses Data Schema - - - -## PUT 更新模型文件状态 UpdateCheckpoint - -PUT /checkpoints/{id} - -更新模型文件状态 -Update Checkpoint - -> Body Parameters - -```json -{ - "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 - } - ] - } -} -``` - -### Params - -|Name|Location|Type|Required|Description| -|---|---|---|---|---| -|id|path|string| yes |none| -|body|body|object| no |none| -|» status|body|string| yes |状态(Status)| -|» multi_parts_tags|body|object| yes |ETags| -|»» v1-5-pruned-emaonly.safetensors|body|[object]| yes |none| -|»»» ETag|body|string| yes |none| -|»»» PartNumber|body|integer| yes |none| - -> Response Examples - -> Success - -```json -{ - "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" - } - } -} -``` - -### Responses - -|HTTP Status Code |Meaning|Description|Data schema| -|---|---|---|---| -|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Success|Inline| - -### Responses Data Schema - -HTTP Status Code **200** - -|Name|Type|Required|Restrictions|Title|description| -|---|---|---|---|---|---| -|» statusCode|integer|true|none||Status Code| -|» headers|object|true|none||none| -|»» Access-Control-Allow-Headers|string|true|none||none| -|»» Access-Control-Allow-Origin|string|true|none||none| -|»» Access-Control-Allow-Methods|string|true|none||none| -|» checkpoint|object|true|none||Checkpoint| -|»» id|string|true|none||ID| -|»» type|string|true|none||Type| -|»» s3_location|string|true|none||S3 Key| -|»» status|string|true|none||Status| -|»» params|object|true|none||none| -|»»» creator|string|true|none||User Name| -|»»» multipart_upload|object|true|none||S3 Multipart Upload| -|»»»» v1-5-pruned-emaonly.safetensors|object|true|none||none| -|»»»»» bucket|string|true|none||none| -|»»»»» upload_id|string|true|none||none| -|»»»»» key|string|true|none||none| -|»»» message|string|true|none||Message| -|»»» created|string|true|none||Created At| - -# 推理端点(Endpoints) - - - -## GET 获取端点列表 ListEndpoints - -GET /endpoints - -获取推理端点列表 -List inference endpoints - -### Params - -|Name|Location|Type|Required|Description| -|---|---|---|---|---| -|Authorization|header|string| yes |none| - -> Response Examples - -> Success - -```json -{ - "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" -} -``` - -### Responses - -|HTTP Status Code |Meaning|Description|Data schema| -|---|---|---|---| -|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Success|Inline| - -### Responses Data Schema - -HTTP Status Code **200** - -|Name|Type|Required|Restrictions|Title|description| -|---|---|---|---|---|---| -|» statusCode|integer|true|none||none| -|» data|object|true|none||none| -|»» endpoints|[object]|true|none||none| -|»»» EndpointDeploymentJobId|string|true|none||none| -|»»» autoscaling|boolean|true|none||none| -|»»» max_instance_number|string|true|none||none| -|»»» startTime|string|true|none||none| -|»»» status|null|true|none||none| -|»»» instance_type|string|true|none||none| -|»»» current_instance_count|string|true|none||none| -|»»» endTime|string|true|none||none| -|»»» endpoint_status|string|true|none||none| -|»»» endpoint_name|string|true|none||none| -|»»» error|null|true|none||none| -|»»» endpoint_type|string|true|none||none| -|»»» owner_group_or_role|[string]|true|none||none| -|» message|string|true|none||none| - - - -## POST 创建端点 CreateEndpoint - -POST /endpoints - -创建推理端点 -Create Endpoint - -> Body Parameters - -```json -{ - "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" -} -``` - -### Params - -|Name|Location|Type|Required|Description| -|---|---|---|---|---| -|Authorization|header|string| yes |none| -|body|body|object| no |none| -|» endpoint_name|body|string| no |端点名称(Endpoint Name)| -|» endpoint_type|body|string| yes |端点类型(Endpoint Type)| -|» instance_type|body|string| yes |实例类型(Instance Type)| -|» initial_instance_count|body|string| yes |初始实例数(Initial Instance Count)| -|» autoscaling_enabled|body|boolean| yes |开启 Autoscaling(Enable Autoscaling)| -|» assign_to_roles|body|[string]| yes |角色列表(Role List)| -|» creator|body|string| yes |创建者用户名(Creator User Name)| - -> Response Examples - -> Success - -```json -{ - "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" - ] - } -} -``` - -### Responses - -|HTTP Status Code |Meaning|Description|Data schema| -|---|---|---|---| -|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Success|Inline| - -### Responses Data Schema - -HTTP Status Code **200** - -|Name|Type|Required|Restrictions|Title|description| -|---|---|---|---|---|---| -|» statusCode|integer|true|none||none| -|» message|string|true|none||none| -|» data|[Endpoint](#schemaendpoint)|true|none||none| -|»» EndpointDeploymentJobId|string|true|none||ID| -|»» autoscaling|boolean|true|none||Autoscaling Enabled| -|»» max_instance_number|string|true|none||Max Instance Count| -|»» startTime|string|true|none||Start Time| -|»» current_instance_count|integer|true|none||Current Instance Count| -|»» endTime|string|true|none||End Time| -|»» endpoint_status|string|true|none||Endpoint Status| -|»» endpoint_name|string|true|none||Endpoint Name| -|»» error|null|true|none||Error Message| -|»» owner_group_or_role|[string]|true|none||Roles| - - - -## DELETE 删除端点 DeleteEndpoints - -DELETE /endpoints - -删除推理端点 -Delete endpoints - -> Body Parameters - -```json -{ - "delete_endpoint_list": [ - "infer-endpoint-test" - ], - "username": "admin" -} -``` - -### Params - -|Name|Location|Type|Required|Description| -|---|---|---|---|---| -|Authorization|header|string| yes |none| -|body|body|object| no |none| -|» delete_endpoint_list|body|[string]| yes |端点名列表(Endpoint Name List)| -|» username|body|string| yes |用户名(User Name)| - -> Response Examples - -> 200 Response - -```json -{} -``` - -### Responses - -|HTTP Status Code |Meaning|Description|Data schema| -|---|---|---|---| -|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Success|Inline| - -### Responses Data Schema - -# 推理(Inferences) - - - -## 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` - -> Body Parameters - -```json -{ - "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" - } -} -``` - -### Params - -|Name|Location|Type|Required|Description| -|---|---|---|---|---| -|body|body|object| no |none| -|» user_id|body|string| yes |用户名(User Name)| -|» inference_type|body|string| yes |推理类型(Inference Type)Async | Real-time| -|» task_type|body|string| yes |任务类型(Task Type)txt2img | img2img | rembg| -|» models|body|object| yes |模型列表(Model List)| -|»» Stable-diffusion|body|[string]| yes |none| -|»» VAE|body|[string]| yes |none| -|»» embeddings|body|[string]| yes |none| -|» filters|body|object| yes |将在下一版本中移除| -|»» createAt|body|number| yes |none| -|»» creator|body|string| yes |none| - -> Response Examples - -> Success - -```json -{ - "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": "https://xxxx.s3.amazonaws.com/txt2img/infer_v2/f3421ce5-9ab9-40a2-b33b-3f126de70a52/api_param.json?AWSAccessKeyId=xxxx&Signature=HNp81KZy2%2FDSgz7%2FWP%2FdMIUPz8s%3D&x-amz-security-token=IQoJb3JpZ2luX2VjEOz%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaDmFwLXNvdXRoZWFzdC0xIkcwRQIgNMLgV7at1Vaao4wiFDgLOk4vc3OwD1D%2F4vyd%2Bz5vxhkCIQCnDqwzj3jP%2BIEyc2hCFw%2FNbWOHE%2BLDOVNFfxowLpQFEyrhAwi1%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F8BEAAaDDg2MDY2MDYwMDY5MCIM%2B6KJWPfr9JG4NBwKKrUDxMOpMiWgg2N1uusnm%2FRpoZhBFTe4MnPMNHf5M%2Bb8mTZWHD1JnMNAda1RUzfc9QoL%2BO76bH2QxhHQgmWaCnoX9i4hQCH7U%2F2slmF4EVSktyKWPbKMr%2BooX4uSpCiuU7qXqgjhPKbEn3tmsfH0RVf%2ByaGLXe6G43JAHpArjaJTIRnmH%2Bszbq55F%2FaifIpjhw9IlB6X18uVTzx9vqepS8zF%2Bn7%2F0L0da%2FhNvzz5QbRxbTrzjtDIGKd7aOz2%2BuXM03naXLcRFDRw29wzbMH2Z2P%2Bran9lZsrJBDYlWN4BMV3PSaweOghOOTldPlxylTzWiE86xWmw5kUpgU%2B4A8Te%2BZmJRl6Qqhq7sOZ%2BaaNTAqpYYQhjkFxLFziZjub90%2B7%2B0idFmQN7CpKEmBUTVdrQGAcagAJ9jQRUosTfRfHP%2BiXK1dj2sOOgDsDOZE6X2O9dpJQCiQAJKDDDvBKPn1s%2BDp7KlgRh5AdlBEgUkfcx3fUyhFz7hrVGLHR74hYIScIM714eDMlPvqtPtznr8IKtRvzKRYGxMyN%2FM%2FdvqhDE2WEHOP9M%2B4bvDBxMTDhNngjdZsMs524zVcw79aGrgY6ngEPUkOghS7xw2T1%2FGr6jR8AIjsdZ4ZsC5BZp22jizDO%2FQBmWEH2Z9LJK6Jmf7XwCRagmOuZlc8ZSr929Q48f371DwbhPGJdwjb7VPYqA20CJkcz6mFrU5zwLm%2BqDB2%2BpNVWIBMWeRsoGfcEipeR%2BVRd5DhVh0gCYc9BqDtshpstnhEvesuPSr8syAt5VQwUEAplxtWGFHh%2BPH3RHcgu%2Bw%3D%3D&Expires=1707194752", - "models": [ - { - "id": "32a7af23-3763-4289-a6af-2156a2331878", - "name": [ - "v1-5-pruned-emaonly.safetensors" - ], - "type": "Stable-diffusion" - }, - { - "id": "VAE", - "name": [ - "Automatic" - ], - "type": "VAE" - } - ] - } - }, - "message": "Created" -} -``` - -### Responses - -|HTTP Status Code |Meaning|Description|Data schema| -|---|---|---|---| -|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Success|Inline| - -### Responses Data Schema - -HTTP Status Code **200** - -|Name|Type|Required|Restrictions|Title|description| -|---|---|---|---|---|---| -|» statusCode|integer|true|none||none| -|» data|object|true|none||none| -|»» inference|object|true|none||none| -|»»» id|string|true|none||none| -|»»» type|string|true|none||none| -|»»» api_params_s3_location|string|true|none||none| -|»»» api_params_s3_upload_url|string|true|none||none| -|»»» models|[object]|true|none||none| -|»»»» id|string|true|none||none| -|»»»» name|[string]|true|none||none| -|»»»» type|string|true|none||none| -|» message|string|true|none||none| - - - -## DELETE 删除推理作业 DeleteInferenceJobs - -DELETE /inferences - -删除推理作业列表 -Delete inference jobs - -> Body Parameters - -```json -{ - "inference_id_list": [ - "99" - ] -} -``` - -### Params - -|Name|Location|Type|Required|Description| -|---|---|---|---|---| -|Authorization|header|string| no |none| -|body|body|object| no |none| -|» inference_id_list|body|[string]| yes |推理作业ID列表(Inference Job ID List)| - -> Response Examples - -> No Content - -```json -{} -``` - -### Responses - -|HTTP Status Code |Meaning|Description|Data schema| -|---|---|---|---| -|204|[No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5)|No Content|Inline| - -### Responses Data Schema - - - -## PUT 开始推理作业 StartInferenceJob - -PUT /inferences/{jobId}/start - -开始推理作业 -Start inference job - -### Params - -|Name|Location|Type|Required|Description| -|---|---|---|---|---| -|jobId|path|string| yes |推理作业ID(Inference Job ID)| -|Authorization|header|string| yes |none| - -> Response Examples - -> Success - -```json -{ - "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" -} -``` - -### Responses - -|HTTP Status Code |Meaning|Description|Data schema| -|---|---|---|---| -|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Success|Inline| - -### Responses Data Schema - -HTTP Status Code **200** - -|Name|Type|Required|Restrictions|Title|description| -|---|---|---|---|---|---| -|» statusCode|integer|true|none||none| -|» data|object|true|none||none| -|»» inference|object|true|none||none| -|»»» inference_id|string|true|none||none| -|»»» status|string|true|none||none| -|»»» endpoint_name|string|true|none||none| -|»»» output_path|string|true|none||none| -|» message|string|true|none||none| - - - -## GET 获取推理作业详情 GetInferenceJob - -GET /inferences/{jobId} - -获取指定的推理作业详情 -Gets a specific inference job - -### Params - -|Name|Location|Type|Required|Description| -|---|---|---|---|---| -|jobId|path|string| yes |推理作业ID(Inference Job ID)| -|Authorization|header|string| yes |none| - -> Response Examples - -> Success - -```json -{ - "statusCode": 200, - "data": { - "img_presigned_urls": [ - "https://xxxx.s3.amazonaws.com/out/9d93e241-745a-4464-bb99-22253c910a01/result/image_0.png?AWSAccessKeyId=xxxx&Signature=%2BIoU%2BUuY0oJmd9yb8B6xJGnRN3Q%3D&x-amz-security-token=IQoJb3JpZ2luX2VjEOz%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaDmFwLXNvdXRoZWFzdC0xIkgwRgIhAJXX4Y7cAU1VjSQK3Ga5Q3oWrK9Pu7e%2BaJ%2FcP89H3DnAAiEAw%2FSIHzSWR01mAw6xb2kqhTgkapA3hRzRlmIgb%2FQuuNsq4QMItf%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FARAAGgw4NjA2NjA2MDA2OTAiDI5nIbuU88AEtxiKeSq1A0em0PiCJywBO91ACgdnEOZhh46%2BcPMBZS8sbo2G7FuNR8VRz4nGIQjp4HdX468AMjoAN7tRidsufLva6L2xTrqmiiEZobRLqc%2FgsJnuxkK0FFbmdW%2B4GSjUWC8NIyICwF4KtL%2FS05fYVQyq5%2FBV%2B%2FVMw0aT5m7ai4E9FkHAgTsMvhxg31L3v%2BPe8A8Y%2BZbuWGdvonMzHE4CYMKAKe6SfvjK7u8U8YHR8IeCFWd90jzlkygIk83oFVOuyybITePaZbxWKuyEvBSJd3T7y46CeThyzc3I8AlmYTrfbuj8BhSqiptedtN5%2BmtMP5q04c3EGpIQ86B13NAUhHDadBeImztplPRLJFUXJsj7AMUHc5I7h8o%2BRXy1xE4GZD382WXsHOKLJ39UkioqRUvWCAozO%2B%2FBsILadh83RUcE7C7HFGd6%2BdnfcWPfjDOr5i%2FI5P%2BeamDL9Cvw9hakaaMSryI8ki3kmMMbubBc2JExOtspIh3SquN2dw6RUtb34mBZerxZhJHNGFsdARrboM7IZA1f8S6oGuMRX7tr67P%2Fgx5alSHiiS%2FvFlNyPqIRk7O3uAlnzLkQ7IgyMO%2FZhq4GOp0B1Fyc2ySOy88xOUvUFDkJHr5dpVYIOkffdqOgGXOi9H0edCyg8xELWZwofu6eT%2FecDv4xvjkHjXyJ%2B3H7KP1%2FmE2IoQSFJBFvI0El1rvg7jsvROTe8QVuNYG9V1PqH3zLLz%2Fw9V1R9fK6ys5ZdlDCm208LClKZq8YlxQWXlOO%2FLMLcR51FJxqu5tqXLAaVIFDNdwO%2BrUyvZx5xMTifg%3D%3D&Expires=1707195462" - ], - "output_presigned_urls": [ - "https://xxxx.s3.amazonaws.com/out/9d93e241-745a-4464-bb99-22253c910a01/result/9d93e241-745a-4464-bb99-22253c910a01_param.json?AWSAccessKeyId=xxxx&Signature=sAi%2ByxVsUBdZfSh34QCMAh%2B2jGg%3D&x-amz-security-token=IQoJb3JpZ2luX2VjEOz%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaDmFwLXNvdXRoZWFzdC0xIkgwRgIhAJXX4Y7cAU1VjSQK3Ga5Q3oWrK9Pu7e%2BaJ%2FcP89H3DnAAiEAw%2FSIHzSWR01mAw6xb2kqhTgkapA3hRzRlmIgb%2FQuuNsq4QMItf%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FARAAGgw4NjA2NjA2MDA2OTAiDI5nIbuU88AEtxiKeSq1A0em0PiCJywBO91ACgdnEOZhh46%2BcPMBZS8sbo2G7FuNR8VRz4nGIQjp4HdX468AMjoAN7tRidsufLva6L2xTrqmiiEZobRLqc%2FgsJnuxkK0FFbmdW%2B4GSjUWC8NIyICwF4KtL%2FS05fYVQyq5%2FBV%2B%2FVMw0aT5m7ai4E9FkHAgTsMvhxg31L3v%2BPe8A8Y%2BZbuWGdvonMzHE4CYMKAKe6SfvjK7u8U8YHR8IeCFWd90jzlkygIk83oFVOuyybITePaZbxWKuyEvBSJd3T7y46CeThyzc3I8AlmYTrfbuj8BhSqiptedtN5%2BmtMP5q04c3EGpIQ86B13NAUhHDadBeImztplPRLJFUXJsj7AMUHc5I7h8o%2BRXy1xE4GZD382WXsHOKLJ39UkioqRUvWCAozO%2B%2FBsILadh83RUcE7C7HFGd6%2BdnfcWPfjDOr5i%2FI5P%2BeamDL9Cvw9hakaaMSryI8ki3kmMMbubBc2JExOtspIh3SquN2dw6RUtb34mBZerxZhJHNGFsdARrboM7IZA1f8S6oGuMRX7tr67P%2Fgx5alSHiiS%2FvFlNyPqIRk7O3uAlnzLkQ7IgyMO%2FZhq4GOp0B1Fyc2ySOy88xOUvUFDkJHr5dpVYIOkffdqOgGXOi9H0edCyg8xELWZwofu6eT%2FecDv4xvjkHjXyJ%2B3H7KP1%2FmE2IoQSFJBFvI0El1rvg7jsvROTe8QVuNYG9V1PqH3zLLz%2Fw9V1R9fK6ys5ZdlDCm208LClKZq8YlxQWXlOO%2FLMLcR51FJxqu5tqXLAaVIFDNdwO%2BrUyvZx5xMTifg%3D%3D&Expires=1707195462" - ], - "startTime": "2024-02-05 06:10:52.552528", - "taskType": "txt2img", - "completeTime": "2024-02-05 06:10:56.270528", - "params": { - "input_body_presign_url": "https://xxxx.s3.amazonaws.com/txt2img/infer_v2/9d93e241-745a-4464-bb99-22253c910a01/api_param.json?AWSAccessKeyId=xxxx&Signature=i8q7mM74oZoqtl6reQCPEklgXkc%3D&x-amz-security-token=IQoJb3JpZ2luX2VjENb%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaDmFwLXNvdXRoZWFzdC0xIkgwRgIhALn6k5IG2ikYnvMq55N8qzxoi0PcGaPgqzQiNfqjU2ueAiEAlD%2B36qo6fakPvbFIO%2FCEBq3OWIZy3PVRc50g11Yh%2BLAq4QMIn%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FARAAGgw4NjA2NjA2MDA2OTAiDP6CmhQmhgcfvjTYpSq1A%2FUxhB9s6Vam%2FSSyEYlgMkVgvRGOntmYPgfgAdGj9j37KcncPzUxzsuttNgVQzP%2Bu9CVAI4QrO02ObsyNPvsy3KOCLmpBRcSmZDqRkPW5%2BTmQwVEAD8AYut7P3CiLt0mIcCcMS8UOZuXbvb6%2FyaPAegYR20bUEfPDiOEvYxyBOrj9%2FdbED5lvSrS3fHucyIVk9wF6tJQQVucqWRA1qllL6Dj%2BIg86dFYkLl2BiYty0Vd0OBT6y51ATmhBJqqz66M5MlKuVvxWZ5ZL7T%2BcNcJyPnukXAADGuBXt6ZjD7QWxve7TQE6aUTHGi6WbF%2FLi0%2BqWOmVoKdootyVT3bCj34rA56NudSO5t0QjBonQ%2BfnFJlB7s1if4UHZUp%2FijPImWJU8uC6PMp9Qshgux3IwCjO6X%2B5GcyWnL1hO5GaljtyERBLQZ8SS2ZHej3kSw9cJ3w%2FN5cCgejLWkbNffQdkyan1XsRav9ufZOHQMNtupz0LEsUIvbctZjip3FLdBp0rwZDfrBEFlpuDEnmzpCbJVIw7BajO7Fqtu%2FzYHeyEH7ZLLHSMFSkK4apzXb2gkhpmM44XalQzu7MLb1ga4GOp0BghTpORcI%2F6KMUkPVI3YuuZ7O5HLQTlq8TYtl9%2BEWIpG8omXyk232ysXfV4hgvVNA1yOfBpa0IEY86LVLIUOGRgNgPtAkBp2Mao9lA0GcAh2XGCCJYRFyvwVU1veBhN5XgNA15dy1Vqp9YC2ZtwMiTxQcy5R6vlm8mI2cKaI0RJWlD9gWhRhlZJZVx5RTgYI6jjhnr0Zis3L52wmd0A%3D%3D&Expires=1707117052", - "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" -} -``` - -### Responses - -|HTTP Status Code |Meaning|Description|Data schema| -|---|---|---|---| -|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Success|Inline| - -### Responses Data Schema - -HTTP Status Code **200** - -|Name|Type|Required|Restrictions|Title|description| -|---|---|---|---|---|---| -|» statusCode|integer|true|none||none| -|» data|object|true|none||none| -|»» img_presigned_urls|[string]|true|none||none| -|»» output_presigned_urls|[string]|true|none||none| -|»» startTime|string|true|none||none| -|»» taskType|string|true|none||none| -|»» completeTime|string|true|none||none| -|»» params|object|true|none||none| -|»»» input_body_presign_url|string|true|none||none| -|»»» used_models|object|true|none||none| -|»»»» Stable-diffusion|[object]|true|none||none| -|»»»»» s3|string|false|none||none| -|»»»»» id|string|false|none||none| -|»»»»» model_name|string|false|none||none| -|»»»»» type|string|false|none||none| -|»»»» VAE|[object]|true|none||none| -|»»»»» s3|string|false|none||none| -|»»»»» id|string|false|none||none| -|»»»»» model_name|string|false|none||none| -|»»»»» type|string|false|none||none| -|»»» input_body_s3|string|true|none||none| -|»»» sagemaker_inference_instance_type|string|true|none||none| -|»»» sagemaker_inference_endpoint_id|string|true|none||none| -|»»» sagemaker_inference_endpoint_name|string|true|none||none| -|»» InferenceJobId|string|true|none||none| -|»» status|string|true|none||none| -|»» inference_type|string|true|none||none| -|»» createTime|string|true|none||none| -|»» image_names|[string]|true|none||none| -|»» owner_group_or_role|[string]|true|none||none| -|» message|string|true|none||none| - -# Data Schema - -

Checkpoint

- - - - - - -```json -{ - "id": "string", - "s3Location": "string", - "type": "string", - "status": "string", - "name": [ - "string" - ], - "created": 0, - "allowed_roles_or_users": [ - "string" - ] -} - -``` - -### Attribute - -|Name|Type|Required|Restrictions|Title|Description| -|---|---|---|---|---|---| -|id|string|true|none||none| -|s3Location|string|true|none||none| -|type|string|true|none||none| -|status|string|true|none||none| -|name|[string]|true|none||none| -|created|number|true|none||none| -|allowed_roles_or_users|[string]|true|none||none| - -

Endpoint

- - - - - - -```json -{ - "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" - ] -} - -``` - -### Attribute - -|Name|Type|Required|Restrictions|Title|Description| -|---|---|---|---|---|---| -|EndpointDeploymentJobId|string|true|none||ID| -|autoscaling|boolean|true|none||Autoscaling Enabled| -|max_instance_number|string|true|none||Max Instance Count| -|startTime|string|true|none||Start Time| -|current_instance_count|integer|true|none||Current Instance Count| -|endTime|string|true|none||End Time| -|endpoint_status|string|true|none||Endpoint Status| -|endpoint_name|string|true|none||Endpoint Name| -|error|null|true|none||Error Message| -|owner_group_or_role|[string]|true|none||Roles| - -

User

- - - - - - -```json -{ - "username": "string", - "roles": [ - "string" - ], - "creator": "string", - "permissions": [ - "string" - ], - "password": "string" -} - -``` - -### Attribute - -|Name|Type|Required|Restrictions|Title|Description| -|---|---|---|---|---|---| -|username|string|true|none||用户名(User Name)| -|roles|[string]|true|none||角色列表(Roles)| -|creator|string|true|none||创建者用户名(Creator User Name)| -|permissions|[string]|true|none||权限列表(Permissions)| -|password|string|true|none||密码(Password)| - -

InferenceJob

- - - - - - -```json -{ - "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" - ] -} - -``` - -### Attribute - -|Name|Type|Required|Restrictions|Title|Description| -|---|---|---|---|---|---| -|startTime|string|true|none||Start Time| -|taskType|string|true|none||Task Type| -|completeTime|string|true|none||Complete Time| -|params|object|true|none||Params| -|» input_body_presign_url|string|true|none||none| -|» used_models|object|true|none||none| -|»» Stable-diffusion|[object]|true|none||none| -|»»» s3|string|false|none||none| -|»»» id|string|false|none||none| -|»»» model_name|string|false|none||none| -|»»» type|string|false|none||none| -|»» Lora|[object]|true|none||none| -|»»» s3|string|false|none||none| -|»»» id|string|false|none||none| -|»»» model_name|string|false|none||none| -|»»» type|string|false|none||none| -|» input_body_s3|string|true|none||none| -|» output_path|string|true|none||none| -|» sagemaker_inference_endpoint_id|string|true|none||none| -|» sagemaker_inference_endpoint_name|string|true|none||none| -|InferenceJobId|string|true|none||Inference Job Id| -|status|string|true|none||Status| -|sagemakerRaw|string|true|none||Sagemaker Raw| -|image_names|[string]|true|none||Images Array| -|owner_group_or_role|[string]|true|none||Roles| - -

Role

- - - - - - -```json -{ - "role_name": "string", - "creator": "string", - "permissions": [ - "string" - ] -} - -``` - -### Attribute - -|Name|Type|Required|Restrictions|Title|Description| -|---|---|---|---|---|---| -|role_name|string|true|none||角色名(Role Name)| -|creator|string|true|none||创建者用户名(Creator User Name)| -|permissions|[string]|true|none||权限列表(Permissions)| - diff --git a/docs/en/developer-guide/api/1.6.0.md b/docs/en/developer-guide/api/1.6.0.md deleted file mode 100644 index 8cbf3751..00000000 --- a/docs/en/developer-guide/api/1.6.0.md +++ /dev/null @@ -1,3 +0,0 @@ -# ESD 1.6.0 - -!!swagger esd-oas.json!! diff --git a/docs/ja/developer-guide/api.md b/docs/ja/developer-guide/api.md new file mode 100644 index 00000000..b313ecea --- /dev/null +++ b/docs/ja/developer-guide/api.md @@ -0,0 +1,3 @@ +# ESD API + +!!swagger oas.json!! diff --git a/docs/ja/developer-guide/api/1.4.0.md b/docs/ja/developer-guide/api/1.4.0.md deleted file mode 100644 index 1b647e6e..00000000 --- a/docs/ja/developer-guide/api/1.4.0.md +++ /dev/null @@ -1,1352 +0,0 @@ - - -# ESD 1.4.0 - -# 健康チェック(Ping) - - - -## 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) - - - -## 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 - - - -## 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) - - - -## 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| - - - -## 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| - - - -## 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) - - - -## 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| - - - - -## 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|インラインの| - -### レスポンスデータスキーマ - - - -## 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) - - - -## 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|なし||なし| - - - -## 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|なし||ロール| - - - -## 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) - - - -## 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|なし||なし| - - - - -## 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)|空のレスポンス|インライン| - -### レスポンスデータスキーマ - - - -## 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|なし||なし| - - - -## 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|なし||なし| - -# データスキーマ - -

Checkpoint

- - - - - - -``` -{ - "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|なし||なし| - -

Endpoint

- - - - - - -``` -{ - "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|なし||ロール| - -

User

- - - - - - -``` -{ - "username": "string", - "roles": [ - "string" - ], - "creator": "string", - "permissions": [ - "string" - ], - "password": "string" -} - -``` - -### 属性 - -|名前|型|必須|制限|タイトル|説明| -|---|---|---|---|---|---| -|username|文字列|true|なし||ユーザー名| -|roles|[文字列]|true|なし||ロールリスト| -|creator|文字列|true|なし||作成者ユーザー名| -|permissions|[文字列]|true|なし||権限リスト| -|password|文字列|true|なし||パスワード| - -

InferenceJob

- - - - - - -``` -{ - "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|なし||ロール| - -

Role

- - - - - - -``` -{ - "role_name": "string", - "creator": "string", - "permissions": [ - "string" - ] -} - -``` - -### 属性 - -|名前|型|必須|制限|タイトル|説明| -|---|---|---|---|---|---| -|role_name|文字列|true|なし||ロール名| -|creator|文字列|true|なし||作成者ユーザー名| -|permissions|[文字列]|true|なし||権限リスト| - diff --git a/docs/ja/developer-guide/api/1.6.0.md b/docs/ja/developer-guide/api/1.6.0.md deleted file mode 100644 index 8cbf3751..00000000 --- a/docs/ja/developer-guide/api/1.6.0.md +++ /dev/null @@ -1,3 +0,0 @@ -# ESD 1.6.0 - -!!swagger esd-oas.json!! diff --git a/docs/mkdocs.en.yml b/docs/mkdocs.en.yml index dc020e54..f39bbc21 100644 --- a/docs/mkdocs.en.yml +++ b/docs/mkdocs.en.yml @@ -44,8 +44,7 @@ nav: - API Inference Process: developer-guide/api_inference_process.md - API Inference Debugger: developer-guide/api_debugger.md - API Authentication: developer-guide/api_authentication.md - - API Version & Details: - - 1.6.0: developer-guide/api/1.6.0.md + - API Details: developer-guide/api.md - Custom Container: developer-guide/byoc.md - Troubleshooting: troubleshooting.md - FAQ: faq.md diff --git a/docs/mkdocs.ja.yml b/docs/mkdocs.ja.yml index 8f285e4a..28f2b4ec 100644 --- a/docs/mkdocs.ja.yml +++ b/docs/mkdocs.ja.yml @@ -43,8 +43,7 @@ nav: - API推論プロセス: developer-guide/api_inference_process.md - API推論デバッガー: developer-guide/api_debugger.md - API認証: developer-guide/api_authentication.md - - APIバージョンと詳細: - - 1.6.0: developer-guide/api/1.6.0.md + - API詳細: developer-guide/api.md - カスタムコンテナ: developer-guide/byoc.md - トラブルシューティング: troubleshooting.md - FAQ: faq.md diff --git a/docs/mkdocs.zh.yml b/docs/mkdocs.zh.yml index dd5fa100..eec365b0 100644 --- a/docs/mkdocs.zh.yml +++ b/docs/mkdocs.zh.yml @@ -51,8 +51,7 @@ nav: - API 推理流程: developer-guide/api_inference_process.md - API 推理调试器: developer-guide/api_debugger.md - API 验证: developer-guide/api_authentication.md - - API 版本和详情: - - 1.6.0: developer-guide/api/1.6.0.md + - API 详情: developer-guide/api.md - 自定义容器镜像: developer-guide/byoc.md - 故障排除: troubleshooting.md - 常见问题解答: faq.md diff --git a/docs/zh/developer-guide/api.md b/docs/zh/developer-guide/api.md new file mode 100644 index 00000000..b313ecea --- /dev/null +++ b/docs/zh/developer-guide/api.md @@ -0,0 +1,3 @@ +# ESD API + +!!swagger oas.json!! diff --git a/docs/zh/developer-guide/api/1.4.0.md b/docs/zh/developer-guide/api/1.4.0.md deleted file mode 100644 index 27142878..00000000 --- a/docs/zh/developer-guide/api/1.4.0.md +++ /dev/null @@ -1,1350 +0,0 @@ -# ESD 1.4.0 - - -# 健康检查(Ping) - - - -## GET 健康检查 (Ping) - -GET /ping - -测试客户端是否可以连接到 API,并检查配置是否正确。 -Test whether client can connect to api and check the API_TOKEN is correct. - -> Response Examples - -> Success - -```json -{ - "message": "pong", - "statusCode": 200 -} -``` - -### Responses - -|HTTP Status Code |Meaning|Description|Data schema| -|---|---|---|---| -|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Success|Inline| - -### Responses Data Schema - -HTTP Status Code **200** - -|Name|Type|Required|Restrictions|Title|description| -|---|---|---|---|---|---| -|» message|string|true|none||none| -|» statusCode|integer|true|none||none| - -# 角色(Roles) - - - -## DELETE 删除角色 DeleteRoles - -DELETE /roles - -删除角色 -Delete roles - -> Body Parameters - -```json -{ - "role_name_list": [ - "role_name_1" - ] -} -``` - -### Params - -|Name|Location|Type|Required|Description| -|---|---|---|---|---| -|Authorization|header|string| yes |none| -|body|body|object| no |none| -|» role_name_list|body|[string]| yes |角色列表(Role Name List)| - -> Response Examples - -> 204 Response - -```json -{} -``` - -### Responses - -|HTTP Status Code |Meaning|Description|Data schema| -|---|---|---|---| -|204|[No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5)|No Content|Inline| - -### Responses Data Schema - - - -## POST 创建角色 CreateRole - -POST /roles - -创建新角色 -Create a new role - -> Body Parameters - -```json -{ - "role_name": "new_role_name", - "creator": "admin", - "permissions": [ - "train:all", - "checkpoint:all" - ] -} -``` - -### Params - -|Name|Location|Type|Required|Description| -|---|---|---|---|---| -|Authorization|header|string| yes |none| -|body|body|[Role](#schemarole)| no |none| - -> Response Examples - -> Created - -```json -{ - "statusCode": 201, - "message": "role created" -} -``` - -### Responses - -|HTTP Status Code |Meaning|Description|Data schema| -|---|---|---|---| -|201|[Created](https://tools.ietf.org/html/rfc7231#section-6.3.2)|Created|Inline| - -### Responses Data Schema - -HTTP Status Code **201** - -|Name|Type|Required|Restrictions|Title|description| -|---|---|---|---|---|---| -|» statusCode|integer|true|none||none| -|» message|string|true|none||none| - -# 用户(Users) - - - -## GET 获取用户列表 ListUsers - -GET /users - -获取用户列表 -List all users - -### Params - -|Name|Location|Type|Required|Description| -|---|---|---|---|---| -|Authorization|header|string| yes |none| - -> Response Examples - -> Success - -```json -{ - "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 Status Code |Meaning|Description|Data schema| -|---|---|---|---| -|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Success|Inline| - -### Responses Data Schema - -HTTP Status Code **200** - -|Name|Type|Required|Restrictions|Title|description| -|---|---|---|---|---|---| -|» 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| - - - -## POST 创建用户 CreateUser - -POST /users - -创建新用户 -Create a new user - -> Body Parameters - -```json -{ - "username": "username", - "password": "XXXXXXXXXXXXX", - "creator": "admin", - "roles": [ - "IT Operator" - ] -} -``` - -### Params - -|Name|Location|Type|Required|Description| -|---|---|---|---|---| -|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 - -```json -{ - "statusCode": 201, - "message": "Created" -} -``` - -### Responses - -|HTTP Status Code |Meaning|Description|Data schema| -|---|---|---|---| -|201|[Created](https://tools.ietf.org/html/rfc7231#section-6.3.2)|Created|Inline| - -### Responses Data Schema - -HTTP Status Code **201** - -|Name|Type|Required|Restrictions|Title|description| -|---|---|---|---|---|---| -|» statusCode|integer|true|none||none| -|» message|string|true|none||none| - - - -## DELETE 删除用户 DeleteUsers - -DELETE /users - -删除用户 -Delete users - -> Body Parameters - -```json -{ - "user_name_list": [ - "string" - ] -} -``` - -### Params - -|Name|Location|Type|Required|Description| -|---|---|---|---|---| -|Authorization|header|string| yes |none| -|body|body|object| no |none| -|» user_name_list|body|[string]| yes |用户名列表(User Name List)| - -> Response Examples - -> 204 Response - -```json -{} -``` - -### Responses - -|HTTP Status Code |Meaning|Description|Data schema| -|---|---|---|---| -|204|[No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5)|No Content|Inline| - -### Responses Data Schema - -# 模型文件(Checkpoints) - - - -## POST 通过URL上传模型文件 CreateCheckpoint - -POST /checkpoints - -通过URL上传模型文件 -Create a new Checkpoint by URL - -> Body Parameters - -```json -{ - "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 - -|Name|Location|Type|Required|Description| -|---|---|---|---|---| -|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 - -```json -{ - "statusCode": 202, - "message": "Checkpoint creation in progress, please check later" -} -``` - -### Responses - -|HTTP Status Code |Meaning|Description|Data schema| -|---|---|---|---| -|202|[Accepted](https://tools.ietf.org/html/rfc7231#section-6.3.3)|Accepted|Inline| - -### Responses Data Schema - -HTTP Status Code **202** - -|Name|Type|Required|Restrictions|Title|description| -|---|---|---|---|---|---| -|» 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| - - - -## DELETE 删除模型文件 DeleteCheckpoints - -DELETE /checkpoints - -删除模型文件 -Delete checkpoints - -> Body Parameters - -```json -{ - "checkpoint_id_list": [ - "string" - ] -} -``` - -### Params - -|Name|Location|Type|Required|Description| -|---|---|---|---|---| -|Authorization|header|string| yes |none| -|body|body|object| no |none| -|» checkpoint_id_list|body|[string]| yes |模型文件ID列表(ID List)| - -> Response Examples - -> 204 Response - -```json -{} -``` - -### Responses - -|HTTP Status Code |Meaning|Description|Data schema| -|---|---|---|---| -|204|[No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5)|No Content|Inline| - -### Responses Data Schema - - - -## PUT 更新模型文件状态 UpdateCheckpoint - -PUT /checkpoints/{id} - -更新模型文件状态 -Update Checkpoint - -> Body Parameters - -```json -{ - "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 - } - ] - } -} -``` - -### Params - -|Name|Location|Type|Required|Description| -|---|---|---|---|---| -|id|path|string| yes |none| -|body|body|object| no |none| -|» status|body|string| yes |状态(Status)| -|» multi_parts_tags|body|object| yes |ETags| -|»» v1-5-pruned-emaonly.safetensors|body|[object]| yes |none| -|»»» ETag|body|string| yes |none| -|»»» PartNumber|body|integer| yes |none| - -> Response Examples - -> Success - -```json -{ - "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" - } - } -} -``` - -### Responses - -|HTTP Status Code |Meaning|Description|Data schema| -|---|---|---|---| -|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Success|Inline| - -### Responses Data Schema - -HTTP Status Code **200** - -|Name|Type|Required|Restrictions|Title|description| -|---|---|---|---|---|---| -|» statusCode|integer|true|none||Status Code| -|» headers|object|true|none||none| -|»» Access-Control-Allow-Headers|string|true|none||none| -|»» Access-Control-Allow-Origin|string|true|none||none| -|»» Access-Control-Allow-Methods|string|true|none||none| -|» checkpoint|object|true|none||Checkpoint| -|»» id|string|true|none||ID| -|»» type|string|true|none||Type| -|»» s3_location|string|true|none||S3 Key| -|»» status|string|true|none||Status| -|»» params|object|true|none||none| -|»»» creator|string|true|none||User Name| -|»»» multipart_upload|object|true|none||S3 Multipart Upload| -|»»»» v1-5-pruned-emaonly.safetensors|object|true|none||none| -|»»»»» bucket|string|true|none||none| -|»»»»» upload_id|string|true|none||none| -|»»»»» key|string|true|none||none| -|»»» message|string|true|none||Message| -|»»» created|string|true|none||Created At| - -# 推理端点(Endpoints) - - - -## GET 获取端点列表 ListEndpoints - -GET /endpoints - -获取推理端点列表 -List inference endpoints - -### Params - -|Name|Location|Type|Required|Description| -|---|---|---|---|---| -|Authorization|header|string| yes |none| - -> Response Examples - -> Success - -```json -{ - "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" -} -``` - -### Responses - -|HTTP Status Code |Meaning|Description|Data schema| -|---|---|---|---| -|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Success|Inline| - -### Responses Data Schema - -HTTP Status Code **200** - -|Name|Type|Required|Restrictions|Title|description| -|---|---|---|---|---|---| -|» statusCode|integer|true|none||none| -|» data|object|true|none||none| -|»» endpoints|[object]|true|none||none| -|»»» EndpointDeploymentJobId|string|true|none||none| -|»»» autoscaling|boolean|true|none||none| -|»»» max_instance_number|string|true|none||none| -|»»» startTime|string|true|none||none| -|»»» status|null|true|none||none| -|»»» instance_type|string|true|none||none| -|»»» current_instance_count|string|true|none||none| -|»»» endTime|string|true|none||none| -|»»» endpoint_status|string|true|none||none| -|»»» endpoint_name|string|true|none||none| -|»»» error|null|true|none||none| -|»»» endpoint_type|string|true|none||none| -|»»» owner_group_or_role|[string]|true|none||none| -|» message|string|true|none||none| - - - -## POST 创建端点 CreateEndpoint - -POST /endpoints - -创建推理端点 -Create Endpoint - -> Body Parameters - -```json -{ - "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" -} -``` - -### Params - -|Name|Location|Type|Required|Description| -|---|---|---|---|---| -|Authorization|header|string| yes |none| -|body|body|object| no |none| -|» endpoint_name|body|string| no |端点名称(Endpoint Name)| -|» endpoint_type|body|string| yes |端点类型(Endpoint Type)| -|» instance_type|body|string| yes |实例类型(Instance Type)| -|» initial_instance_count|body|string| yes |初始实例数(Initial Instance Count)| -|» autoscaling_enabled|body|boolean| yes |开启 Autoscaling(Enable Autoscaling)| -|» assign_to_roles|body|[string]| yes |角色列表(Role List)| -|» creator|body|string| yes |创建者用户名(Creator User Name)| - -> Response Examples - -> Success - -```json -{ - "statusCode": 200, - "message": "Endpoint deployment started: esd-type-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": "esd-type-prod", - "error": null, - "owner_group_or_role": [ - "IT Operator" - ] - } -} -``` - -### Responses - -|HTTP Status Code |Meaning|Description|Data schema| -|---|---|---|---| -|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Success|Inline| - -### Responses Data Schema - -HTTP Status Code **200** - -|Name|Type|Required|Restrictions|Title|description| -|---|---|---|---|---|---| -|» statusCode|integer|true|none||none| -|» message|string|true|none||none| -|» data|[Endpoint](#schemaendpoint)|true|none||none| -|»» EndpointDeploymentJobId|string|true|none||ID| -|»» autoscaling|boolean|true|none||Autoscaling Enabled| -|»» max_instance_number|string|true|none||Max Instance Count| -|»» startTime|string|true|none||Start Time| -|»» current_instance_count|integer|true|none||Current Instance Count| -|»» endTime|string|true|none||End Time| -|»» endpoint_status|string|true|none||Endpoint Status| -|»» endpoint_name|string|true|none||Endpoint Name| -|»» error|null|true|none||Error Message| -|»» owner_group_or_role|[string]|true|none||Roles| - - - -## DELETE 删除端点 DeleteEndpoints - -DELETE /endpoints - -删除推理端点 -Delete endpoints - -> Body Parameters - -```json -{ - "delete_endpoint_list": [ - "esd-type-test" - ], - "username": "admin" -} -``` - -### Params - -|Name|Location|Type|Required|Description| -|---|---|---|---|---| -|Authorization|header|string| yes |none| -|body|body|object| no |none| -|» delete_endpoint_list|body|[string]| yes |端点名列表(Endpoint Name List)| -|» username|body|string| yes |用户名(User Name)| - -> Response Examples - -> 200 Response - -```json -{} -``` - -### Responses - -|HTTP Status Code |Meaning|Description|Data schema| -|---|---|---|---| -|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Success|Inline| - -### Responses Data Schema - -# 推理(Inferences) - - - -## 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` - -> Body Parameters - -```json -{ - "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" - } -} -``` - -### Params - -|Name|Location|Type|Required|Description| -|---|---|---|---|---| -|body|body|object| no |none| -|» user_id|body|string| yes |用户名(User Name)| -|» inference_type|body|string| yes |推理类型(Inference Type)Async | Real-time| -|» task_type|body|string| yes |任务类型(Task Type)txt2img | img2img | rembg| -|» models|body|object| yes |模型列表(Model List)| -|»» Stable-diffusion|body|[string]| yes |none| -|»» VAE|body|[string]| yes |none| -|»» embeddings|body|[string]| yes |none| -|» filters|body|object| yes |将在下一版本中移除| -|»» createAt|body|number| yes |none| -|»» creator|body|string| yes |none| - -> Response Examples - -> Success - -```json -{ - "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": "https://xxxx.s3.amazonaws.com/txt2img/infer_v2/f3421ce5-9ab9-40a2-b33b-3f126de70a52/api_param.json?AWSAccessKeyId=xxxx&Signature=HNp81KZy2%2FDSgz7%2FWP%2FdMIUPz8s%3D&x-amz-security-token=IQoJb3JpZ2luX2VjEOz%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaDmFwLXNvdXRoZWFzdC0xIkcwRQIgNMLgV7at1Vaao4wiFDgLOk4vc3OwD1D%2F4vyd%2Bz5vxhkCIQCnDqwzj3jP%2BIEyc2hCFw%2FNbWOHE%2BLDOVNFfxowLpQFEyrhAwi1%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F8BEAAaDDg2MDY2MDYwMDY5MCIM%2B6KJWPfr9JG4NBwKKrUDxMOpMiWgg2N1uusnm%2FRpoZhBFTe4MnPMNHf5M%2Bb8mTZWHD1JnMNAda1RUzfc9QoL%2BO76bH2QxhHQgmWaCnoX9i4hQCH7U%2F2slmF4EVSktyKWPbKMr%2BooX4uSpCiuU7qXqgjhPKbEn3tmsfH0RVf%2ByaGLXe6G43JAHpArjaJTIRnmH%2Bszbq55F%2FaifIpjhw9IlB6X18uVTzx9vqepS8zF%2Bn7%2F0L0da%2FhNvzz5QbRxbTrzjtDIGKd7aOz2%2BuXM03naXLcRFDRw29wzbMH2Z2P%2Bran9lZsrJBDYlWN4BMV3PSaweOghOOTldPlxylTzWiE86xWmw5kUpgU%2B4A8Te%2BZmJRl6Qqhq7sOZ%2BaaNTAqpYYQhjkFxLFziZjub90%2B7%2B0idFmQN7CpKEmBUTVdrQGAcagAJ9jQRUosTfRfHP%2BiXK1dj2sOOgDsDOZE6X2O9dpJQCiQAJKDDDvBKPn1s%2BDp7KlgRh5AdlBEgUkfcx3fUyhFz7hrVGLHR74hYIScIM714eDMlPvqtPtznr8IKtRvzKRYGxMyN%2FM%2FdvqhDE2WEHOP9M%2B4bvDBxMTDhNngjdZsMs524zVcw79aGrgY6ngEPUkOghS7xw2T1%2FGr6jR8AIjsdZ4ZsC5BZp22jizDO%2FQBmWEH2Z9LJK6Jmf7XwCRagmOuZlc8ZSr929Q48f371DwbhPGJdwjb7VPYqA20CJkcz6mFrU5zwLm%2BqDB2%2BpNVWIBMWeRsoGfcEipeR%2BVRd5DhVh0gCYc9BqDtshpstnhEvesuPSr8syAt5VQwUEAplxtWGFHh%2BPH3RHcgu%2Bw%3D%3D&Expires=1707194752", - "models": [ - { - "id": "32a7af23-3763-4289-a6af-2156a2331878", - "name": [ - "v1-5-pruned-emaonly.safetensors" - ], - "type": "Stable-diffusion" - }, - { - "id": "VAE", - "name": [ - "Automatic" - ], - "type": "VAE" - } - ] - } - }, - "message": "Created" -} -``` - -### Responses - -|HTTP Status Code |Meaning|Description|Data schema| -|---|---|---|---| -|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Success|Inline| - -### Responses Data Schema - -HTTP Status Code **200** - -|Name|Type|Required|Restrictions|Title|description| -|---|---|---|---|---|---| -|» statusCode|integer|true|none||none| -|» data|object|true|none||none| -|»» inference|object|true|none||none| -|»»» id|string|true|none||none| -|»»» type|string|true|none||none| -|»»» api_params_s3_location|string|true|none||none| -|»»» api_params_s3_upload_url|string|true|none||none| -|»»» models|[object]|true|none||none| -|»»»» id|string|true|none||none| -|»»»» name|[string]|true|none||none| -|»»»» type|string|true|none||none| -|» message|string|true|none||none| - - - -## DELETE 删除推理作业 DeleteInferenceJobs - -DELETE /inferences - -删除推理作业列表 -Delete inference jobs - -> Body Parameters - -```json -{ - "inference_id_list": [ - "99" - ] -} -``` - -### Params - -|Name|Location|Type|Required|Description| -|---|---|---|---|---| -|Authorization|header|string| no |none| -|body|body|object| no |none| -|» inference_id_list|body|[string]| yes |推理作业ID列表(Inference Job ID List)| - -> Response Examples - -> No Content - -```json -{} -``` - -### Responses - -|HTTP Status Code |Meaning|Description|Data schema| -|---|---|---|---| -|204|[No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5)|No Content|Inline| - -### Responses Data Schema - - - -## PUT 开始推理作业 StartInferenceJob - -PUT /inferences/{jobId}/start - -开始推理作业 -Start inference job - -### Params - -|Name|Location|Type|Required|Description| -|---|---|---|---|---| -|jobId|path|string| yes |推理作业ID(Inference Job ID)| -|Authorization|header|string| yes |none| - -> Response Examples - -> Success - -```json -{ - "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" -} -``` - -### Responses - -|HTTP Status Code |Meaning|Description|Data schema| -|---|---|---|---| -|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Success|Inline| - -### Responses Data Schema - -HTTP Status Code **200** - -|Name|Type|Required|Restrictions|Title|description| -|---|---|---|---|---|---| -|» statusCode|integer|true|none||none| -|» data|object|true|none||none| -|»» inference|object|true|none||none| -|»»» inference_id|string|true|none||none| -|»»» status|string|true|none||none| -|»»» endpoint_name|string|true|none||none| -|»»» output_path|string|true|none||none| -|» message|string|true|none||none| - - - -## GET 获取推理作业详情 GetInferenceJob - -GET /inferences/{jobId} - -获取指定的推理作业详情 -Gets a specific inference job - -### Params - -|Name|Location|Type|Required|Description| -|---|---|---|---|---| -|jobId|path|string| yes |推理作业ID(Inference Job ID)| -|Authorization|header|string| yes |none| - -> Response Examples - -> Success - -```json -{ - "statusCode": 200, - "data": { - "img_presigned_urls": [ - "https://xxxx.s3.amazonaws.com/out/9d93e241-745a-4464-bb99-22253c910a01/result/image_0.png?AWSAccessKeyId=xxxx&Signature=%2BIoU%2BUuY0oJmd9yb8B6xJGnRN3Q%3D&x-amz-security-token=IQoJb3JpZ2luX2VjEOz%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaDmFwLXNvdXRoZWFzdC0xIkgwRgIhAJXX4Y7cAU1VjSQK3Ga5Q3oWrK9Pu7e%2BaJ%2FcP89H3DnAAiEAw%2FSIHzSWR01mAw6xb2kqhTgkapA3hRzRlmIgb%2FQuuNsq4QMItf%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FARAAGgw4NjA2NjA2MDA2OTAiDI5nIbuU88AEtxiKeSq1A0em0PiCJywBO91ACgdnEOZhh46%2BcPMBZS8sbo2G7FuNR8VRz4nGIQjp4HdX468AMjoAN7tRidsufLva6L2xTrqmiiEZobRLqc%2FgsJnuxkK0FFbmdW%2B4GSjUWC8NIyICwF4KtL%2FS05fYVQyq5%2FBV%2B%2FVMw0aT5m7ai4E9FkHAgTsMvhxg31L3v%2BPe8A8Y%2BZbuWGdvonMzHE4CYMKAKe6SfvjK7u8U8YHR8IeCFWd90jzlkygIk83oFVOuyybITePaZbxWKuyEvBSJd3T7y46CeThyzc3I8AlmYTrfbuj8BhSqiptedtN5%2BmtMP5q04c3EGpIQ86B13NAUhHDadBeImztplPRLJFUXJsj7AMUHc5I7h8o%2BRXy1xE4GZD382WXsHOKLJ39UkioqRUvWCAozO%2B%2FBsILadh83RUcE7C7HFGd6%2BdnfcWPfjDOr5i%2FI5P%2BeamDL9Cvw9hakaaMSryI8ki3kmMMbubBc2JExOtspIh3SquN2dw6RUtb34mBZerxZhJHNGFsdARrboM7IZA1f8S6oGuMRX7tr67P%2Fgx5alSHiiS%2FvFlNyPqIRk7O3uAlnzLkQ7IgyMO%2FZhq4GOp0B1Fyc2ySOy88xOUvUFDkJHr5dpVYIOkffdqOgGXOi9H0edCyg8xELWZwofu6eT%2FecDv4xvjkHjXyJ%2B3H7KP1%2FmE2IoQSFJBFvI0El1rvg7jsvROTe8QVuNYG9V1PqH3zLLz%2Fw9V1R9fK6ys5ZdlDCm208LClKZq8YlxQWXlOO%2FLMLcR51FJxqu5tqXLAaVIFDNdwO%2BrUyvZx5xMTifg%3D%3D&Expires=1707195462" - ], - "output_presigned_urls": [ - "https://xxxx.s3.amazonaws.com/out/9d93e241-745a-4464-bb99-22253c910a01/result/9d93e241-745a-4464-bb99-22253c910a01_param.json?AWSAccessKeyId=xxxx&Signature=sAi%2ByxVsUBdZfSh34QCMAh%2B2jGg%3D&x-amz-security-token=IQoJb3JpZ2luX2VjEOz%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaDmFwLXNvdXRoZWFzdC0xIkgwRgIhAJXX4Y7cAU1VjSQK3Ga5Q3oWrK9Pu7e%2BaJ%2FcP89H3DnAAiEAw%2FSIHzSWR01mAw6xb2kqhTgkapA3hRzRlmIgb%2FQuuNsq4QMItf%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FARAAGgw4NjA2NjA2MDA2OTAiDI5nIbuU88AEtxiKeSq1A0em0PiCJywBO91ACgdnEOZhh46%2BcPMBZS8sbo2G7FuNR8VRz4nGIQjp4HdX468AMjoAN7tRidsufLva6L2xTrqmiiEZobRLqc%2FgsJnuxkK0FFbmdW%2B4GSjUWC8NIyICwF4KtL%2FS05fYVQyq5%2FBV%2B%2FVMw0aT5m7ai4E9FkHAgTsMvhxg31L3v%2BPe8A8Y%2BZbuWGdvonMzHE4CYMKAKe6SfvjK7u8U8YHR8IeCFWd90jzlkygIk83oFVOuyybITePaZbxWKuyEvBSJd3T7y46CeThyzc3I8AlmYTrfbuj8BhSqiptedtN5%2BmtMP5q04c3EGpIQ86B13NAUhHDadBeImztplPRLJFUXJsj7AMUHc5I7h8o%2BRXy1xE4GZD382WXsHOKLJ39UkioqRUvWCAozO%2B%2FBsILadh83RUcE7C7HFGd6%2BdnfcWPfjDOr5i%2FI5P%2BeamDL9Cvw9hakaaMSryI8ki3kmMMbubBc2JExOtspIh3SquN2dw6RUtb34mBZerxZhJHNGFsdARrboM7IZA1f8S6oGuMRX7tr67P%2Fgx5alSHiiS%2FvFlNyPqIRk7O3uAlnzLkQ7IgyMO%2FZhq4GOp0B1Fyc2ySOy88xOUvUFDkJHr5dpVYIOkffdqOgGXOi9H0edCyg8xELWZwofu6eT%2FecDv4xvjkHjXyJ%2B3H7KP1%2FmE2IoQSFJBFvI0El1rvg7jsvROTe8QVuNYG9V1PqH3zLLz%2Fw9V1R9fK6ys5ZdlDCm208LClKZq8YlxQWXlOO%2FLMLcR51FJxqu5tqXLAaVIFDNdwO%2BrUyvZx5xMTifg%3D%3D&Expires=1707195462" - ], - "startTime": "2024-02-05 06:10:52.552528", - "taskType": "txt2img", - "completeTime": "2024-02-05 06:10:56.270528", - "params": { - "input_body_presign_url": "https://xxxx.s3.amazonaws.com/txt2img/infer_v2/9d93e241-745a-4464-bb99-22253c910a01/api_param.json?AWSAccessKeyId=xxxx&Signature=i8q7mM74oZoqtl6reQCPEklgXkc%3D&x-amz-security-token=IQoJb3JpZ2luX2VjENb%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaDmFwLXNvdXRoZWFzdC0xIkgwRgIhALn6k5IG2ikYnvMq55N8qzxoi0PcGaPgqzQiNfqjU2ueAiEAlD%2B36qo6fakPvbFIO%2FCEBq3OWIZy3PVRc50g11Yh%2BLAq4QMIn%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FARAAGgw4NjA2NjA2MDA2OTAiDP6CmhQmhgcfvjTYpSq1A%2FUxhB9s6Vam%2FSSyEYlgMkVgvRGOntmYPgfgAdGj9j37KcncPzUxzsuttNgVQzP%2Bu9CVAI4QrO02ObsyNPvsy3KOCLmpBRcSmZDqRkPW5%2BTmQwVEAD8AYut7P3CiLt0mIcCcMS8UOZuXbvb6%2FyaPAegYR20bUEfPDiOEvYxyBOrj9%2FdbED5lvSrS3fHucyIVk9wF6tJQQVucqWRA1qllL6Dj%2BIg86dFYkLl2BiYty0Vd0OBT6y51ATmhBJqqz66M5MlKuVvxWZ5ZL7T%2BcNcJyPnukXAADGuBXt6ZjD7QWxve7TQE6aUTHGi6WbF%2FLi0%2BqWOmVoKdootyVT3bCj34rA56NudSO5t0QjBonQ%2BfnFJlB7s1if4UHZUp%2FijPImWJU8uC6PMp9Qshgux3IwCjO6X%2B5GcyWnL1hO5GaljtyERBLQZ8SS2ZHej3kSw9cJ3w%2FN5cCgejLWkbNffQdkyan1XsRav9ufZOHQMNtupz0LEsUIvbctZjip3FLdBp0rwZDfrBEFlpuDEnmzpCbJVIw7BajO7Fqtu%2FzYHeyEH7ZLLHSMFSkK4apzXb2gkhpmM44XalQzu7MLb1ga4GOp0BghTpORcI%2F6KMUkPVI3YuuZ7O5HLQTlq8TYtl9%2BEWIpG8omXyk232ysXfV4hgvVNA1yOfBpa0IEY86LVLIUOGRgNgPtAkBp2Mao9lA0GcAh2XGCCJYRFyvwVU1veBhN5XgNA15dy1Vqp9YC2ZtwMiTxQcy5R6vlm8mI2cKaI0RJWlD9gWhRhlZJZVx5RTgYI6jjhnr0Zis3L52wmd0A%3D%3D&Expires=1707117052", - "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" -} -``` - -### Responses - -|HTTP Status Code |Meaning|Description|Data schema| -|---|---|---|---| -|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Success|Inline| - -### Responses Data Schema - -HTTP Status Code **200** - -|Name|Type|Required|Restrictions|Title|description| -|---|---|---|---|---|---| -|» statusCode|integer|true|none||none| -|» data|object|true|none||none| -|»» img_presigned_urls|[string]|true|none||none| -|»» output_presigned_urls|[string]|true|none||none| -|»» startTime|string|true|none||none| -|»» taskType|string|true|none||none| -|»» completeTime|string|true|none||none| -|»» params|object|true|none||none| -|»»» input_body_presign_url|string|true|none||none| -|»»» used_models|object|true|none||none| -|»»»» Stable-diffusion|[object]|true|none||none| -|»»»»» s3|string|false|none||none| -|»»»»» id|string|false|none||none| -|»»»»» model_name|string|false|none||none| -|»»»»» type|string|false|none||none| -|»»»» VAE|[object]|true|none||none| -|»»»»» s3|string|false|none||none| -|»»»»» id|string|false|none||none| -|»»»»» model_name|string|false|none||none| -|»»»»» type|string|false|none||none| -|»»» input_body_s3|string|true|none||none| -|»»» sagemaker_inference_instance_type|string|true|none||none| -|»»» sagemaker_inference_endpoint_id|string|true|none||none| -|»»» sagemaker_inference_endpoint_name|string|true|none||none| -|»» InferenceJobId|string|true|none||none| -|»» status|string|true|none||none| -|»» inference_type|string|true|none||none| -|»» createTime|string|true|none||none| -|»» image_names|[string]|true|none||none| -|»» owner_group_or_role|[string]|true|none||none| -|» message|string|true|none||none| - -# Data Schema - -

Checkpoint

- - - - - - -```json -{ - "id": "string", - "s3Location": "string", - "type": "string", - "status": "string", - "name": [ - "string" - ], - "created": 0, - "allowed_roles_or_users": [ - "string" - ] -} - -``` - -### Attribute - -|Name|Type|Required|Restrictions|Title|Description| -|---|---|---|---|---|---| -|id|string|true|none||none| -|s3Location|string|true|none||none| -|type|string|true|none||none| -|status|string|true|none||none| -|name|[string]|true|none||none| -|created|number|true|none||none| -|allowed_roles_or_users|[string]|true|none||none| - -

Endpoint

- - - - - - -```json -{ - "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" - ] -} - -``` - -### Attribute - -|Name|Type|Required|Restrictions|Title|Description| -|---|---|---|---|---|---| -|EndpointDeploymentJobId|string|true|none||ID| -|autoscaling|boolean|true|none||Autoscaling Enabled| -|max_instance_number|string|true|none||Max Instance Count| -|startTime|string|true|none||Start Time| -|current_instance_count|integer|true|none||Current Instance Count| -|endTime|string|true|none||End Time| -|endpoint_status|string|true|none||Endpoint Status| -|endpoint_name|string|true|none||Endpoint Name| -|error|null|true|none||Error Message| -|owner_group_or_role|[string]|true|none||Roles| - -

User

- - - - - - -```json -{ - "username": "string", - "roles": [ - "string" - ], - "creator": "string", - "permissions": [ - "string" - ], - "password": "string" -} - -``` - -### Attribute - -|Name|Type|Required|Restrictions|Title|Description| -|---|---|---|---|---|---| -|username|string|true|none||用户名(User Name)| -|roles|[string]|true|none||角色列表(Roles)| -|creator|string|true|none||创建者用户名(Creator User Name)| -|permissions|[string]|true|none||权限列表(Permissions)| -|password|string|true|none||密码(Password)| - -

InferenceJob

- - - - - - -```json -{ - "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" - ] -} - -``` - -### Attribute - -|Name|Type|Required|Restrictions|Title|Description| -|---|---|---|---|---|---| -|startTime|string|true|none||Start Time| -|taskType|string|true|none||Task Type| -|completeTime|string|true|none||Complete Time| -|params|object|true|none||Params| -|» input_body_presign_url|string|true|none||none| -|» used_models|object|true|none||none| -|»» Stable-diffusion|[object]|true|none||none| -|»»» s3|string|false|none||none| -|»»» id|string|false|none||none| -|»»» model_name|string|false|none||none| -|»»» type|string|false|none||none| -|»» Lora|[object]|true|none||none| -|»»» s3|string|false|none||none| -|»»» id|string|false|none||none| -|»»» model_name|string|false|none||none| -|»»» type|string|false|none||none| -|» input_body_s3|string|true|none||none| -|» output_path|string|true|none||none| -|» sagemaker_inference_endpoint_id|string|true|none||none| -|» sagemaker_inference_endpoint_name|string|true|none||none| -|InferenceJobId|string|true|none||Inference Job Id| -|status|string|true|none||Status| -|sagemakerRaw|string|true|none||Sagemaker Raw| -|image_names|[string]|true|none||Images Array| -|owner_group_or_role|[string]|true|none||Roles| - -

Role

- - - - - - -```json -{ - "role_name": "string", - "creator": "string", - "permissions": [ - "string" - ] -} - -``` - -### Attribute - -|Name|Type|Required|Restrictions|Title|Description| -|---|---|---|---|---|---| -|role_name|string|true|none||角色名(Role Name)| -|creator|string|true|none||创建者用户名(Creator User Name)| -|permissions|[string]|true|none||权限列表(Permissions)| - diff --git a/docs/zh/developer-guide/api/1.6.0.md b/docs/zh/developer-guide/api/1.6.0.md deleted file mode 100644 index 8cbf3751..00000000 --- a/docs/zh/developer-guide/api/1.6.0.md +++ /dev/null @@ -1,3 +0,0 @@ -# ESD 1.6.0 - -!!swagger esd-oas.json!!