> ## Documentation Index
> Fetch the complete documentation index at: https://docs.versori.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Change the execution pool of an environment

> Updates the execution pool used to deploy this environment. If the environment is running it will be suspended first.
This will result in a new public URL being created for the environment.




## OpenAPI

````yaml /openapi/platform-api.yaml put /o/{organisation_id}/projects/{project_id}/environments/execution-pools
openapi: 3.1.0
info:
  title: Versori Platform API
  version: 0.0.1
  license:
    name: UNLICENSED
servers:
  - description: Production
    url: https://platform.versori.com/api/v2
  - description: Staging
    url: https://platform-staging.versori.com/api/v2
  - description: Development
    url: http://localhost:8901
security:
  - bearerToken: []
  - cookie: []
paths:
  /o/{organisation_id}/projects/{project_id}/environments/execution-pools:
    parameters:
      - $ref: '#/components/parameters/project_id'
      - $ref: '#/components/parameters/project_env'
      - $ref: '#/components/parameters/organisation_id'
    put:
      tags:
        - projects
      summary: Change the execution pool of an environment
      description: >
        Updates the execution pool used to deploy this environment. If the
        environment is running it will be suspended first.

        This will result in a new public URL being created for the environment.
      operationId: ChangeEnvironmentExecutionPool
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChangeEnvironmentExecutionPoolRequest'
      responses:
        '200':
          description: Variables updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectEnvironment'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  parameters:
    project_id:
      name: project_id
      in: path
      required: true
      schema:
        type: string
        format: ulid
        x-go-type: ulid.ULID
        x-go-name: ProjectID
        x-go-type-import:
          path: versori.dev/vergo/ulid
    project_env:
      name: project_env
      in: query
      required: false
      schema:
        type: string
    organisation_id:
      name: organisation_id
      in: path
      required: true
      schema:
        type: string
        format: ulid
        x-go-type: ulid.ULID
        x-go-name: OrganisationID
        x-go-type-import:
          path: versori.dev/vergo/ulid
  schemas:
    ChangeEnvironmentExecutionPoolRequest:
      description: >
        ChangeEnvironmentExecutionPoolRequest is the request payload to update
        an environment's execution pool.
      type: object
      properties:
        executionPool:
          type: string
          description: The name of the execution pool used to deploy this environment.
      required:
        - executionPool
    ProjectEnvironment:
      type: object
      properties:
        id:
          type: string
          description: The unique identifier for the environment.
          format: ulid
          x-go-name: ID
          x-go-type: ulid.ULID
          x-go-type-import:
            path: versori.dev/vergo/ulid
        name:
          type: string
        status:
          type: string
          description: One of running|suspended|error|draft.
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        publicUrl:
          type: string
        executionPool:
          type: string
          description: The name of the execution pool used to deploy this environment.
          x-go-type-skip-optional-pointer: true
        files:
          type: array
          description: The currently deployed files for the environment.
          items:
            $ref: '#/components/schemas/File'
          x-go-type-skip-optional-pointer: true
        labels:
          $ref: '#/components/schemas/Labels'
        config:
          $ref: '#/components/schemas/EnvironmentConfig'
        deployedVersion:
          $ref: '#/components/schemas/ProjectVersion'
      required:
        - id
        - name
        - status
        - createdAt
        - updatedAt
        - publicUrl
        - lastDeployedAt
        - config
    Error:
      type: object
      properties:
        code:
          type: string
          description: Code is a machine-readable error code.
        message:
          type: string
          description: Message is a human-readable error message.
        fields:
          type: array
          items:
            $ref: '#/components/schemas/ErrorField'
          x-go-type-skip-optional-pointer: true
        details:
          type: string
          x-go-type-skip-optional-pointer: true
      required:
        - code
        - message
    File:
      type: object
      properties:
        filename:
          type: string
          description: The name of the file.
        content:
          type: string
          description: The content of the file.
      required:
        - filename
        - content
    Labels:
      type: object
      description: >
        Labels is a map of key-value pairs that can be used to store arbitrary
        metadata about a resource.

        Keys must start with a letter and can only contain letters, numbers, and
        underscores.

        Values can be any string.
      x-go-type: map[string]string
      x-go-type-skip-optional-pointer: true
    EnvironmentConfig:
      type: object
      properties:
        deploymentSpec:
          $ref: '#/components/schemas/DeploymentSpec'
    ProjectVersion:
      type: object
      properties:
        id:
          type: string
          description: The unique identifier for the version.
          format: ulid
          x-go-name: ID
          x-go-type: ulid.ULID
          x-go-type-skip-optional-pointer: true
          x-go-type-import:
            path: versori.dev/vergo/ulid
        name:
          type: string
          x-go-type-skip-optional-pointer: true
          description: >
            The short name for this version. This name must be unique within
            this project.
        description:
          type: string
          x-go-type-skip-optional-pointer: true
          description: |
            The description of this version.
        labels:
          type: object
          x-go-type-skip-optional-pointer: true
          x-go-type: map[string]string
          description: |
            Key-value pairs of strings.
        state:
          $ref: '#/components/schemas/VersionState'
        createdAt:
          type: string
          format: date-time
      required:
        - id
        - name
        - state
        - createdAt
    ErrorField:
      description: ErrorField denotes a field which has an error.
      type: object
      properties:
        field:
          type: string
          description: >
            Field is the name of the field which has an error, this may be a
            path to a nested field, including array

            elements. The format of this field is of the form:
            "field1.field2[0].field3"
        message:
          type: string
          description: Message is the error message for this specific field.
      required:
        - field
        - message
    DeploymentSpec:
      type: object
      properties:
        replicas:
          type: integer
        autoscaling:
          $ref: '#/components/schemas/DeploymentAutoscaling'
          x-go-type-skip-optional-pointer: true
        staticIP:
          type: boolean
          description: >
            If set to true it will configure the environment to use the static
            IP for the execution pool selected by the environment.
        resources:
          $ref: '#/components/schemas/Resources'
        serviceAccountName:
          type: string
    VersionState:
      type: string
      description: The state of the version.
      enum:
        - draft
        - failed
        - ready
        - superseded
    DeploymentAutoscaling:
      type: object
      properties:
        maxReplicas:
          type: integer
          description: >-
            The maximum number of replicas that can be created for this
            environment. When this is configured autoscaling will be enabled for
            the environment.
    Resources:
      type: object
      properties:
        limits:
          $ref: '#/components/schemas/ResourceRequirements'
        requests:
          $ref: '#/components/schemas/ResourceRequirements'
    ResourceRequirements:
      type: object
      properties:
        cpu:
          type: string
        memory:
          type: string
  securitySchemes:
    bearerToken:
      description: >
        Bearer token authentication used by the Versori Platform. External
        consumers must provide an API key, however

        internal consumers must provide a JWT id_token issued by our IdP.
      type: http
      scheme: bearer
    cookie:
      description: Cookie authentication used by the Versori Platform.
      type: apiKey
      in: cookie
      name: cookie

````