> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-home-button.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# サービスの状態を更新

> サービスを開始または停止します



## OpenAPI

````yaml /ja/products/cloud/api-reference/cloud-openapi.json patch /v1/organizations/{organizationId}/services/{serviceId}/state
openapi: 3.0.1
info:
  contact:
    email: support@clickhouse.com
    name: ClickHouse Support
    url: >-
      https://clickhouse.com/docs/en/cloud/manage/openapi?referrer=openapi-299828
  title: OpenAPI spec for ClickHouse Cloud
  version: '1.0'
servers:
  - url: https://api.clickhouse.cloud
security:
  - basicAuth: []
tags:
  - name: Organization
  - name: User management
  - name: Billing
  - name: Service
  - name: Backup
  - name: OpenAPI
  - name: Prometheus
  - name: ClickPipes
paths:
  /v1/organizations/{organizationId}/services/{serviceId}/state:
    patch:
      tags:
        - Service
      summary: サービスの状態を更新
      description: サービスを開始または停止します
      parameters:
        - description: サービスを所有する組織のID。
          in: path
          name: organizationId
          required: true
          schema:
            format: uuid
            type: string
        - description: 状態を更新する対象サービスのID。
          in: path
          name: serviceId
          required: true
          schema:
            format: uuid
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ServiceStatePatchRequest'
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  requestId:
                    description: 各リクエストに割り当てられる一意のID。UUIDv4
                    format: uuid
                    type: string
                  result:
                    $ref: '#/components/schemas/Service'
                  status:
                    description: HTTPステータスコード。
                    example: 200
                    type: number
                type: object
          description: 成功レスポンス
        '400':
          content:
            application/json:
              schema:
                properties:
                  error:
                    description: 詳細なエラーの説明。
                    type: string
                  status:
                    description: HTTPステータスコード。
                    example: 400
                    type: number
                type: object
          description: クライアントエラーと判断される何らかの理由により、サーバーがリクエストを処理できない、または処理しない場合。
components:
  schemas:
    ServiceStatePatchRequest:
      properties:
        command:
          description: 'state を変更するコマンド: ''start''、''stop''。'
          enum:
            - start
            - stop
          type: string
    Service:
      properties:
        availablePrivateEndpointIds:
          description: サービスにアタッチできる利用可能なプライベート エンドポイント ID の一覧
          items:
            type: string
          type: array
        byocId:
          description: >-
            これは、Bring Your Own Cloud (BYOC) 用のリージョン設定後に返される ID です。byocId
            パラメーターを指定する場合、minReplicaMemoryGb および maxReplicaGb
            パラメーターも必須であり、その値は次のサイズのいずれかである必要があります: 48、116、172、232。
          type: string
        clickhouseVersion:
          description: サービスの ClickHouse バージョン。
          type: string
        complianceType:
          description: サービスの規制コンプライアンスの種類。
          enum:
            - hipaa
            - pci
          type: string
        createdAt:
          description: サービスの作成タイムスタンプ。ISO-8601。
          format: date-time
          type: string
        dataWarehouseId:
          description: このサービスを含むデータ warehouse
          type: string
        encryptionAssumedRoleIdentifier:
          description: ディスク暗号化に使用する任意のロール
          type: string
        encryptionKey:
          description: 任意の顧客提供ディスク暗号化鍵
          type: string
        encryptionRoleId:
          description: >-
            暗号化に使用する IAM ロールの ID。hasTransparentDataEncryption が true
            の場合にのみ使用できます。
          type: string
        endpoints:
          description: すべてのサービスエンドポイントの一覧。
          items:
            $ref: '#/components/schemas/ServiceEndpoint'
          type: array
        hasTransparentDataEncryption:
          description: >-
            サービスで Transparent Data Encryption (TDE) を有効にする場合は true。TDE は
            ENTERPRISE 組織ティアでのみ使用でき、サービス作成時にのみ有効化できます。
          type: boolean
        iamRole:
          description: S3 内のオブジェクトへのアクセスに使用する IAM ロール
          type: string
        id:
          description: 一意のサービス ID。
          format: uuid
          type: string
        idleScaling:
          description: true に設定すると、サービスはアイドル時に 0 までスケールダウンできます。デフォルトは true です。
          type: boolean
        idleTimeoutMinutes:
          description: 最小アイドルタイムアウトを設定します（分単位）。5 分以上である必要があります。
          type: number
        ipAccessList:
          description: サービスへのアクセスを許可する IP アドレスの一覧
          items:
            $ref: '#/components/schemas/IpAccessListEntry'
          type: array
        isPrimary:
          description: このサービスがデータ warehouse のプライマリサービスである場合は true
          type: boolean
        isReadonly:
          description: このサービスが読み取り専用の場合は true。読み取り専用にできるのは、dataWarehouseId が指定されている場合のみです。
          type: boolean
        maxReplicaMemoryGb:
          description: >-
            自動スケーリング中の各レプリカの合計最大メモリ（Gb）。4 の倍数で、無料サービスでは 120* 以下、有料サービスでは 356*
            以下である必要があります。* -
            レプリカの最大サイズは、選択したリージョンで利用可能なクラウドプロバイダーのハードウェアによって異なります。 
          example: 120
          maximum: 356
          minimum: 8
          multipleOf: 4
          type: number
        maxTotalMemoryGb:
          deprecated: true
          description: >-
            非推奨 - デフォルト以外のレプリカ数を持つサービスでは不正確です。自動スケーリング中の 3
            つのワーカーの最大メモリ（Gb）。'production' サービスでのみ使用できます。無料サービスでは 12 の倍数かつ 360
            以下、有料サービスでは 1068 以下である必要があります。
          example: 360
          maximum: 1068
          minimum: 24
          multipleOf: 12
          type: number
        minReplicaMemoryGb:
          description: 自動スケーリング中の各レプリカの合計最小メモリ（Gb）。4 の倍数かつ 8 以上である必要があります。
          example: 16
          maximum: 356
          minimum: 8
          multipleOf: 4
          type: number
        minTotalMemoryGb:
          deprecated: true
          description: >-
            非推奨 - デフォルト以外のレプリカ数を持つサービスでは不正確です。自動スケーリング中の 3
            つのワーカーの最小メモリ（Gb）。'production' サービスでのみ使用できます。12 の倍数かつ 24
            以上である必要があります。
          example: 48
          maximum: 1068
          minimum: 24
          multipleOf: 12
          type: number
        name:
          description: サービス名。空白を含む英数字文字列で、最大 50 文字です。
          type: string
        numReplicas:
          description: >-
            サービスのレプリカ数。warehouse 内の最初のサービスでは、レプリカ数は 2 ～ 20 の範囲である必要があります。既存の
            warehouse 内に作成されるサービスでは、レプリカ数を 1
            まで設定できます。組織のティアに応じて、さらに制限が適用される場合があります。デフォルトは BASIC ティアで 1、SCALE および
            ENTERPRISE ティアで 3 です。
          example: 3
          maximum: 20
          minimum: 1
          type: number
        privateEndpointIds:
          description: プライベート エンドポイントの一覧
          items:
            type: string
          type: array
        profile:
          description: カスタム インスタンスプロファイル。ENTERPRISE 組織ティアでのみ使用できます。
          enum:
            - v1-default
            - v1-highmem-xs
            - v1-highmem-s
            - v1-highmem-m
            - v1-highmem-l
            - v1-highmem-xl
            - v1-highcpu-s
            - v1-highcpu-m
            - v1-highcpu-l
            - v1-highcpu-xl
          type: string
        provider:
          description: クラウドプロバイダー
          enum:
            - aws
            - gcp
            - azure
          type: string
        region:
          description: サービスのリージョン。
          enum:
            - ap-northeast-1
            - ap-south-1
            - ap-southeast-1
            - ap-southeast-2
            - eu-central-1
            - eu-west-1
            - eu-west-2
            - me-central-1
            - us-east-1
            - us-east-2
            - us-west-2
            - us-east1
            - us-central1
            - europe-west4
            - asia-southeast1
            - eastus
            - eastus2
            - westus3
            - germanywestcentral
          type: string
        releaseChannel:
          description: >-
            新しい ClickHouse リリースを利用可能になり次第すぐに取得したい場合は fast
            を選択します。新機能をより早く利用できますが、バグのリスクは高くなります。リリースを遅らせてテスト時間をより多く確保したい場合は
            slow を選択します。この機能は production サービスでのみ使用できます。デフォルトは通常のリリースチャネルです。
          enum:
            - slow
            - default
            - fast
          type: string
        state:
          description: サービスの現在の状態。
          enum:
            - starting
            - stopping
            - terminating
            - awaking
            - partially_running
            - provisioning
            - running
            - stopped
            - terminated
            - degraded
            - failed
            - idle
          type: string
        tier:
          deprecated: true
          description: >-
            BASIC、SCALE、ENTERPRISE の組織ティアでは非推奨。サービスのティア:
            'development'、'production'、'dedicated_high_mem'、'dedicated_high_cpu'、'dedicated_standard'、'dedicated_standard_n2d_standard_4'、'dedicated_standard_n2d_standard_8'、'dedicated_standard_n2d_standard_32'、'dedicated_standard_n2d_standard_128'、'dedicated_standard_n2d_standard_32_16SSD'、'dedicated_standard_n2d_standard_64_24SSD'。Production
            サービスはスケーリング可能で、Development は固定サイズです。Azure サービスは Development
            ティアをサポートしていません
          enum:
            - development
            - production
            - dedicated_high_mem
            - dedicated_high_cpu
            - dedicated_standard
            - dedicated_standard_n2d_standard_4
            - dedicated_standard_n2d_standard_8
            - dedicated_standard_n2d_standard_32
            - dedicated_standard_n2d_standard_128
            - dedicated_standard_n2d_standard_32_16SSD
            - dedicated_standard_n2d_standard_64_24SSD
          type: string
        transparentDataEncryptionKeyId:
          description: >-
            サービスで使用される Transparent Data Encryption キーの
            ID。hasTransparentDataEncryption が true の場合にのみ使用できます。
          type: string
    ServiceEndpoint:
      properties:
        host:
          description: サービスのホスト名
          type: string
        port:
          description: ポート番号
          type: number
        protocol:
          description: 'エンドポイントのプロトコル: ''https''、''nativesecure''、''mysql''。'
          enum:
            - https
            - nativesecure
            - mysql
          example: mysql
          type: string
        username:
          description: エンドポイント用の任意のユーザー名
          nullable: true
          type: string
    IpAccessListEntry:
      properties:
        description:
          description: アクセスを許可する IPv4 アドレスまたは IPv4 CIDR についての任意の説明
          type: string
        source:
          description: IP または CIDR
          type: string
  securitySchemes:
    basicAuth:
      description: >-
        ClickHouse Cloud コンソールで取得した key ID と key secret を使用してください:
        https://clickhouse.com/docs/cloud/manage/openapi
      scheme: basic
      type: http

````