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

# تحديث حالة الخدمة

> بدء الخدمة أو إيقافها



## OpenAPI

````yaml /ar/_specs/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: معرّف المؤسسة المالكة للخدمة.
          in: path
          name: organizationId
          required: true
          schema:
            format: uuid
            type: string
        - description: معرّف الخدمة المطلوب تحديث حالتها.
          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: معرّف فريد يُخصَّص لكل طلب. 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: 'الأمر المستخدم لتغيير الحالة: ''start''، ''stop''.'
          enum:
            - start
            - stop
          type: string
    Service:
      properties:
        availablePrivateEndpointIds:
          description: قائمة بمعرّفات private endpoints المتاحة التي يمكن إرفاقها بالخدمة
          items:
            type: string
          type: array
        byocId:
          description: >-
            هذا هو المعرّف الذي يتم إرجاعه بعد إعداد Region لـ Bring Your Own
            Cloud (BYOC). عند تحديد parameter ‏byocId، يصبح parameter
            ‏minReplicaMemoryGb وparameter ‏maxReplicaGb مطلوبَين أيضًا، على أن
            تكون القيم من بين الأحجام التالية: 48 و116 و172 و232.
          type: string
        clickhouseVersion:
          description: إصدار ClickHouse الخاص بالخدمة.
          type: string
        complianceType:
          description: نوع الامتثال التنظيمي الخاص بالخدمة.
          enum:
            - hipaa
            - pci
          type: string
        createdAt:
          description: timestamp إنشاء الخدمة. ISO-8601.
          format: date-time
          type: string
        dataWarehouseId:
          description: warehouse البيانات الذي يحتوي على هذه الخدمة
          type: string
        encryptionAssumedRoleIdentifier:
          description: Role اختياري لاستخدامه في تشفير disk
          type: string
        encryptionKey:
          description: مفتاح اختياري لتشفير disk يوفّره العميل
          type: string
        encryptionRoleId:
          description: >-
            معرّف IAM role المستخدم للتشفير. لا يتوفر هذا إلا إذا كانت
            hasTransparentDataEncryption تساوي true.
          type: string
        endpoints:
          description: قائمة بجميع endpoints الخاصة بالخدمة.
          items:
            $ref: '#/components/schemas/ServiceEndpoint'
          type: array
        hasTransparentDataEncryption:
          description: >-
            True إذا كان يجب تمكين Transparent Data Encryption (TDE) للخدمة.
            تكون TDE متاحة فقط لـ ENTERPRISE organization tiers، ولا يمكن
            تمكينها إلا عند إنشاء الخدمة.
          type: boolean
        iamRole:
          description: IAM role يُستخدم للوصول إلى objects في s3
          type: string
        id:
          description: المعرّف الفريد للخدمة.
          format: uuid
          type: string
        idleScaling:
          description: >-
            عند ضبطها على true، يُسمح للخدمة بأن تتوسّع نزولًا إلى الصفر عند
            idling. تكون القيمة الافتراضية True.
          type: boolean
        idleTimeoutMinutes:
          description: اضبط الحد الأدنى لمهلة idling (بالدقائق). يجب أن تكون >= 5 دقائق.
          type: number
        ipAccessList:
          description: قائمة بعناوين IP المسموح لها بالوصول إلى الخدمة
          items:
            $ref: '#/components/schemas/IpAccessListEntry'
          type: array
        isPrimary:
          description: True إذا كانت هذه الخدمة هي primary service في warehouse البيانات
          type: boolean
        isReadonly:
          description: >-
            True إذا كانت هذه الخدمة للقراءة فقط. لا يمكن أن تكون للقراءة فقط
            إلا إذا تم توفير dataWarehouseId.
          type: boolean
        maxReplicaMemoryGb:
          description: >-
            الحد الأقصى لإجمالي الذاكرة لكل replica أثناء التوسّع التلقائي،
            بالغيغابايت. يجب أن يكون من مضاعفات 4 وأقل من أو يساوي 120* للخدمات
            غير المدفوعة أو 356* للخدمات المدفوعة. *- يعتمد الحد الأقصى لحجم
            replica على مدى توفّر عتاد موفّر Cloud في المنطقة التي اخترتها.
          example: 120
          maximum: 356
          minimum: 8
          multipleOf: 4
          type: number
        maxTotalMemoryGb:
          deprecated: true
          description: >-
            مهمل - غير دقيق للخدمات التي تحتوي على أعداد replicas غير افتراضية.
            الحد الأقصى لذاكرة ثلاثة workers أثناء التوسّع التلقائي،
            بالغيغابايت. متاح فقط لخدمات 'production'. يجب أن يكون من مضاعفات 12
            وأقل من أو يساوي 360 للخدمات غير المدفوعة أو 1068 للخدمات المدفوعة.
          example: 360
          maximum: 1068
          minimum: 24
          multipleOf: 12
          type: number
        minReplicaMemoryGb:
          description: >-
            الحد الأدنى لإجمالي الذاكرة لكل replica أثناء التوسّع التلقائي،
            بالغيغابايت. يجب أن يكون من مضاعفات 4 وأكبر من أو يساوي 8.
          example: 16
          maximum: 356
          minimum: 8
          multipleOf: 4
          type: number
        minTotalMemoryGb:
          deprecated: true
          description: >-
            مهمل - غير دقيق للخدمات التي تحتوي على أعداد replicas غير افتراضية.
            الحد الأدنى لذاكرة ثلاثة workers أثناء التوسّع التلقائي،
            بالغيغابايت. متاح فقط لخدمات 'production'. يجب أن يكون من مضاعفات 12
            وأكبر من أو يساوي 24.
          example: 48
          maximum: 1068
          minimum: 24
          multipleOf: 12
          type: number
        name:
          description: اسم الخدمة. سلسلة أبجدية رقمية تتضمن مسافات، بحد أقصى 50 حرفًا.
          type: string
        numReplicas:
          description: >-
            عدد replicas للخدمة. يجب أن يتراوح عدد replicas بين 2 و20 بالنسبة
            إلى أول خدمة في warehouse. يمكن أن يكون عدد replicas للخدمات التي
            يتم إنشاؤها في warehouse موجود منخفضًا حتى 1. قد تنطبق قيود إضافية
            بحسب tier مؤسستك. تكون القيمة الافتراضية 1 لـ BASIC tier و3 لـ SCALE
            وENTERPRISE tiers.
          example: 3
          maximum: 20
          minimum: 1
          type: number
        privateEndpointIds:
          description: قائمة private endpoints
          items:
            type: string
          type: array
        profile:
          description: profile instance مخصص. متاح فقط لـ ENTERPRISE organization tiers.
          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: >-
            حدّد fast إذا كنت تريد الحصول على ClickHouse releases الجديدة بمجرد
            توفرها. ستحصل على New Features بسرعة أكبر، ولكن مع احتمال أعلى لظهور
            الأخطاء. حدّد slow إذا كنت ترغب في تأجيل releases لمنح نفسك مزيدًا
            من الوقت للاختبار. هذه feature متاحة فقط لخدمات production. القيمة
            الافتراضية هي regular release channel.
          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. tier
            الخدمة: ‏'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 لا تدعم tier
            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 المستخدم للخدمة. لا يتوفر
            هذا إلا إذا كانت hasTransparentDataEncryption تساوي true.
          type: string
    ServiceEndpoint:
      properties:
        host:
          description: اسم مضيف الخدمة
          type: string
        port:
          description: رقم المنفذ
          type: number
        protocol:
          description: 'بروتوكول endpoint: ''https''، ''nativesecure''، ''mysql''.'
          enum:
            - https
            - nativesecure
            - mysql
          example: mysql
          type: string
        username:
          description: اسم مستخدم اختياري لـ endpoint
          nullable: true
          type: string
    IpAccessListEntry:
      properties:
        description:
          description: وصف اختياري لعنوان IPv4 أو IPv4 CIDR المسموح بالوصول منه
          type: string
        source:
          description: IP أو CIDR
          type: string
  securitySchemes:
    basicAuth:
      description: >-
        استخدم معرّف المفتاح والسرّ الخاص به اللذين تم الحصول عليهما من
        ClickHouse Cloud console:
        https://clickhouse.com/docs/cloud/manage/openapi
      scheme: basic
      type: http

````