openapi: 3.2.0 info: title: Sakura Internet Application API version: 1.4.0 contact: name: SAKURA internet Inc. license: name: Copyright(C) SAKURA internet Inc. all rights reserved. description: 'Operations tagged application across 2 of this provider''s published API definitions: apprun-dedicated-api.yaml, sakura-internet-apprun-dedicated-openapi.yml. Each path carries the servers of the definition it was published in.' servers: - url: https://secure.sakura.ad.jp/cloud/api/apprun-dedicated/1.0 description: AppRun専有型 API エンドポイント variables: {} security: - BasicAuth: [] tags: - name: Application paths: /applications: post: operationId: createApplication summary: 新しいアプリケーションの作成 description: 指定したクラスタに新しいアプリケーションを作成します。1アカウントにつき最大10個まで作成可能です。 parameters: [] responses: '200': description: The request has succeeded. content: application/json: schema: $ref: '#/components/schemas/CreateApplicationResponse' default: description: An unexpected error response. content: application/json: schema: $ref: '#/components/schemas/Error' tags: - Application requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateApplicationRequest' get: operationId: listApplications summary: アカウント内のアプリケーションの一覧を取得 description: 指定したアカウントに紐づくアプリケーションの一覧を返します。 parameters: - name: clusterID in: query required: false schema: $ref: '#/components/schemas/ClusterID' explode: false - name: cursor in: query required: false description: 前ページの最後のID。これ以降のデータを取得するためのカーソル。ページネーションに利用します。 schema: $ref: '#/components/schemas/ApplicationID' explode: false - name: maxItems in: query required: true description: 1ページあたりの最大取得件数。 schema: type: integer format: int64 minimum: 1 maximum: 30 default: 20 explode: false responses: '200': description: The request has succeeded. content: application/json: schema: $ref: '#/components/schemas/ListApplicationsResponse' default: description: An unexpected error response. content: application/json: schema: $ref: '#/components/schemas/Error' tags: - Application servers: - url: https://secure.sakura.ad.jp/cloud/api/apprun-dedicated/1.0 description: AppRun専有型 API エンドポイント variables: {} /applications/{applicationID}: get: operationId: readApplication summary: アプリケーションの詳細を取得 description: 指定したアプリケーションIDの詳細を返します。 parameters: - name: applicationID in: path required: true schema: $ref: '#/components/schemas/ApplicationID' responses: '200': description: The request has succeeded. content: application/json: schema: $ref: '#/components/schemas/ReadApplicationResponse' default: description: An unexpected error response. content: application/json: schema: $ref: '#/components/schemas/Error' tags: - Application put: operationId: updateApplication summary: アプリケーション情報の更新 description: アプリケーションのactiveVersionなどを更新します。クラスタの変更はできません。activeVersionを変更すると指定したバージョンがデプロイされます。activeVersionをnullにするとアプリケーションは非アクティブ状態になり、デプロイされなくなります。アプリケーション削除前にはactiveVersionをnullにする必要があります。 parameters: - name: applicationID in: path required: true schema: $ref: '#/components/schemas/ApplicationID' responses: '204': description: 'There is no content to send for this request, but the headers may be useful. ' default: description: An unexpected error response. content: application/json: schema: $ref: '#/components/schemas/Error' tags: - Application requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/UpdateApplicationRequest' delete: operationId: deleteApplication summary: アプリケーションの削除 description: '指定したアプリケーションを削除します。 ## 前提条件 - 当該アプリケーションに **アクティブなバージョンが存在しない** こと - いずれのワーカノードでも当該アプリケーションの **コンテナが稼働していない** こと' parameters: - name: applicationID in: path required: true schema: $ref: '#/components/schemas/ApplicationID' responses: '204': description: 'There is no content to send for this request, but the headers may be useful. ' default: description: An unexpected error response. content: application/json: schema: $ref: '#/components/schemas/Error' tags: - Application servers: - url: https://secure.sakura.ad.jp/cloud/api/apprun-dedicated/1.0 description: AppRun専有型 API エンドポイント variables: {} /applications/{applicationID}/containers: get: operationId: listApplicationContainers summary: アプリケーションのノードごとのコンテナ配置情報を取得 description: 指定したアプリケーションの各ワーカノード上でのコンテナ配置情報を返します。 parameters: - name: applicationID in: path required: true schema: $ref: '#/components/schemas/ApplicationID' responses: '200': description: The request has succeeded. content: application/json: schema: $ref: '#/components/schemas/ListApplicationContainersResponse' default: description: An unexpected error response. content: application/json: schema: $ref: '#/components/schemas/Error' tags: - Application servers: - url: https://secure.sakura.ad.jp/cloud/api/apprun-dedicated/1.0 description: AppRun専有型 API エンドポイント variables: {} components: schemas: ApplicationDesiredContainer: type: object required: - applicationID - applicationVersion - cpuMillis - memoryMB - image properties: applicationID: allOf: - $ref: '#/components/schemas/ApplicationID' description: デプロイするアプリケーションID applicationVersion: allOf: - $ref: '#/components/schemas/ApplicationVersionNumber' description: デプロイするアプリケーションのバージョン cpuMillis: type: integer format: int64 description: 割り当てるCPU(単位:mCPU) memoryMB: type: integer format: int64 description: 割り当てるメモリ(単位:MB) image: type: string description: デプロイするコンテナのイメージ名 ReadApplication: type: object required: - applicationID - name - clusterID - clusterName - activeVersion - desiredCount - scalingCooldownSeconds - enoughResources properties: applicationID: allOf: - $ref: '#/components/schemas/ApplicationID' description: ID name: type: string minLength: 1 maxLength: 20 pattern: ^[a-zA-Z0-9_-]+$ description: アプリケーションの名前。クラスタの中ではユニーク。英数字とハイフン、アンダースコアのみ使用可能 example: bbs clusterID: allOf: - $ref: '#/components/schemas/ClusterID' description: デプロイ先クラスタ clusterName: type: string description: クラスタ名 example: 開発用 activeVersion: type: - integer - 'null' allOf: - $ref: '#/components/schemas/ApplicationVersionNumber' description: 利用しているバージョン example: 3 desiredCount: type: - integer - 'null' format: int32 description: デプロイされているべきコンテナ数。activeVersionが未指定の場合はnull。 scalingCooldownSeconds: type: integer format: int32 description: スケーリングのクールダウン時間(秒) enoughResources: allOf: - $ref: '#/components/schemas/EnoughResources' description: アプリケーションをデプロイするクラスタのリソースが十分かどうか description: アプリケーション CreateApplicationRequest: type: object required: - name - clusterID properties: name: type: string minLength: 1 maxLength: 20 pattern: ^[a-zA-Z0-9_-]+$ description: アプリケーションの名前。クラスタの中ではユニーク。英数字とハイフン、アンダースコアのみ使用可能 example: bbs clusterID: allOf: - $ref: '#/components/schemas/ClusterID' description: デプロイ先クラスタ ClusterID: type: string format: uuid description: クラスタID example: 13B9EA83-DDB0-4385-9533-3D693A6A310F ApplicationCurrentContainers: type: object required: - collectedAtSec - containers properties: collectedAtSec: type: integer format: unixtime description: 状態回収日時:UNIX時間(秒) containers: type: array items: $ref: '#/components/schemas/ApplicationCurrentContainer' WorkerNodeID: type: string format: uuid ApplicationDesiredContainers: type: object required: - containers properties: containers: type: array items: $ref: '#/components/schemas/ApplicationDesiredContainer' Error: type: object required: - status - title properties: status: type: integer format: int32 title: type: string WorkerNodeContainerPlacement: type: object required: - nodeID - containersStats - desired properties: nodeID: allOf: - $ref: '#/components/schemas/WorkerNodeID' description: ワーカノードID containersStats: type: - object - 'null' allOf: - $ref: '#/components/schemas/ApplicationCurrentContainers' description: 現在配置されているコンテナ情報 desired: type: - object - 'null' allOf: - $ref: '#/components/schemas/ApplicationDesiredContainers' description: desired(目標配置)情報 ReadApplicationResponse: type: object required: - application properties: application: allOf: - $ref: '#/components/schemas/ReadApplication' description: アプリケーションの情報 example: application: applicationID: A0199B39-B361-45B9-8DF4-FC8BE494D690 name: my-app clusterID: 13B9EA83-DDB0-4385-9533-3D693A6A310F clusterName: mock-cluster activeVersion: 3 desiredCount: 3 scalingCooldownSeconds: 300 enoughResources: cpu: true memory: true ListApplicationContainersResponse: type: object required: - nodes properties: nodes: type: array items: $ref: '#/components/schemas/WorkerNodeContainerPlacement' description: ノードごとのコンテナ配置情報リスト example: nodes: - nodeID: b7e6a1c2-3f4d-4e2a-9b1a-2c3d4e5f6a7b containersStats: collectedAtSec: 1721203200 containers: - id: container-1 image: nginx:latest state: running status: Up 5 minutes cpuUsagePercent: 12.5 applicationID: f47ac10b-58cc-4372-a567-0e02b2c3d479 applicationVersion: 2 desired: containers: [] - nodeID: c8f7b2d3-4e5f-5a6b-8c2d-3e4f5a6b7c8d containersStats: collectedAtSec: 1721203200 containers: [] desired: containers: - applicationID: 9c858901-8a57-4791-81fe-4c455b099bc9 applicationVersion: 1 cpuMillis: 250 memoryMB: 128 image: redis:alpine ApplicationCurrentContainer: type: object required: - id - image - state - status - cpuUsagePercent - applicationID - applicationVersion properties: id: type: string description: コンテナID image: type: string description: イメージ名 state: type: string description: コンテナのステート(created、running、restarting、removing、paused、exited、dead のうちいずれか) status: type: string description: コンテナのステータス cpuUsagePercent: type: number format: float description: コンテナのCPU使用率(単位:%) applicationID: allOf: - $ref: '#/components/schemas/ApplicationID' description: アプリケーションID applicationVersion: allOf: - $ref: '#/components/schemas/ApplicationVersionNumber' description: アプリケーションのバージョン ApplicationVersionNumber: type: integer format: int32 minimum: 1 example: 3 ApplicationID: type: string format: uuid UpdateApplicationRequest: type: object required: - activeVersion properties: activeVersion: type: - integer - 'null' allOf: - $ref: '#/components/schemas/ApplicationVersionNumber' description: 利用しているバージョン example: 3 EnoughResources: type: object required: - cpu - memory properties: cpu: type: - boolean - 'null' description: CPU不足が原因でアプリケーションがデプロイできない場合はfalse。ASGスケールアウト中もfalse。nullの場合は不明。 memory: type: - boolean - 'null' description: メモリ不足が原因でアプリケーションがデプロイできない場合はfalse。ASGスケールアウト中もfalse。nullの場合は不明。 ListApplicationsResponse: type: object required: - applications properties: applications: type: array items: $ref: '#/components/schemas/ReadApplication' description: アプリケーションの一覧 nextCursor: allOf: - $ref: '#/components/schemas/ApplicationID' description: 次ページのカーソル。次のリクエストでcursorとして指定する。データが残っていなければnull。 example: applications: - applicationID: A0199B39-B361-45B9-8DF4-FC8BE494D690 name: my-app clusterID: 13B9EA83-DDB0-4385-9533-3D693A6A310F clusterName: mock-cluster activeVersion: 3 desiredCount: 3 scalingCooldownSeconds: 300 enoughResources: cpu: true memory: true ApplicationIdentifier: type: object required: - applicationID properties: applicationID: allOf: - $ref: '#/components/schemas/ApplicationID' description: ID readOnly: true CreateApplicationResponse: type: object required: - application properties: application: allOf: - $ref: '#/components/schemas/ApplicationIdentifier' description: 作成されたアプリケーションの情報 securitySchemes: BasicAuth: type: http scheme: Basic externalDocs: url: https://manual.sakura.ad.jp/cloud/apprun-dedicated/releasenote.html description: リリースノート | さくらのクラウド マニュアル x-refined-from: - apprun-dedicated-api.yaml - sakura-internet-apprun-dedicated-openapi.yml