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

# Update a file storage directory quota

> Update the limits, defaults, rules, name and tags of a Directory Quota. The path cannot change and is not part of the request. Omitted limits and rules are cleared, and spec.rules replaces the full rule list.



## OpenAPI

````yaml /openapi/region-openapi.yaml put /api/v2/filestorage/{filestorageID}/directoryquotas/{filestorageDirectoryQuotaID}
openapi: 3.0.3
info:
  title: Region Service API
  description: >-
    Cloud region discovery and routing service.  This is service not intended
    for direct access

    by end users.  Region related functionality is typically exposed by higher
    level services

    e.g. Compute and Kubernetes, that provide subsets of resources that are
    compatible with

    that service.
  version: 1.13.0
servers:
  - url: https://region.nks.europe-west4.nscale.com
    description: Production
security: []
paths:
  /api/v2/filestorage/{filestorageID}/directoryquotas/{filestorageDirectoryQuotaID}:
    description: A directory quota of a file storage resource.
    parameters:
      - $ref: '#/components/parameters/filestorageIDParameter'
      - $ref: '#/components/parameters/filestorageDirectoryQuotaIDParameter'
    put:
      tags:
        - File storage directory quotas
      summary: Update a file storage directory quota
      description: >-
        Update the limits, defaults, rules, name and tags of a Directory Quota.
        The path cannot change and is not part of the request. Omitted limits
        and rules are cleared, and spec.rules replaces the full rule list.
      requestBody:
        $ref: '#/components/requestBodies/fileStorageDirectoryQuotaV2UpdateRequest'
      responses:
        '202':
          $ref: '#/components/responses/fileStorageDirectoryQuotaV2Response'
        '400':
          $ref: '#/components/responses/badRequestResponse'
        '401':
          $ref: '#/components/responses/unauthorizedResponse'
        '403':
          $ref: '#/components/responses/forbiddenResponse'
        '404':
          $ref: '#/components/responses/notFoundResponse'
        '409':
          $ref: '#/components/responses/conflictResponse'
        '422':
          $ref: '#/components/responses/unprocessableContentResponse'
        '500':
          $ref: '#/components/responses/internalServerErrorResponse'
      security:
        - oauth2Authentication: []
components:
  parameters:
    filestorageIDParameter:
      name: filestorageID
      in: path
      description: The storage unique identifier.
      required: true
      schema:
        $ref: '#/components/schemas/fileStorageId'
    filestorageDirectoryQuotaIDParameter:
      name: filestorageDirectoryQuotaID
      in: path
      description: The Directory Quota unique identifier.
      required: true
      schema:
        $ref: '#/components/schemas/fileStorageDirectoryQuotaId'
  requestBodies:
    fileStorageDirectoryQuotaV2UpdateRequest:
      description: A request to update a Directory Quota.
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/fileStorageDirectoryQuotaV2Update'
          example:
            metadata:
              name: homedir-example-1
            spec:
              directoryLimits:
                capacityBytes: 16363825397760
                inodes: 100000000
              defaultUserLimits:
                capacityBytes: 10737418240
  responses:
    fileStorageDirectoryQuotaV2Response:
      description: A File Storage Directory Quota.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/fileStorageDirectoryQuotaV2Read'
    badRequestResponse:
      description: |-
        Request body failed schema validation, or the request does not contain
        all the required fields.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
          example:
            error: invalid_request
            error_description: request body invalid
            trace_id: 57bc14d9bd461f0b5a72db830149b67a
    unauthorizedResponse:
      description: Authentication failed or the access token has expired.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
          example:
            error: access_denied
            error_description: authentication failed
            trace_id: 57bc14d9bd461f0b5a72db830149b67a
    forbiddenResponse:
      description: >-
        Request was denied by authorization, this may be caused by the
        authorization

        token not having the required scope for an API, or the user doesn't have
        the

        necessary privileges on the provider platform.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
          example:
            error: forbidden
            error_description: user credentials do not have the required privileges
            trace_id: 57bc14d9bd461f0b5a72db830149b67a
    notFoundResponse:
      description: Unable to find a resource.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
          example:
            error: not_found
            error_description: the requested resource does not exist
            trace_id: 57bc14d9bd461f0b5a72db830149b67a
    conflictResponse:
      description: >-
        Resource conflicts with another, usually this means they have the same
        name.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
          example:
            error: conflict
            error_description: a resource with the same name already exists
            trace_id: 57bc14d9bd461f0b5a72db830149b67a
    unprocessableContentResponse:
      description: >-
        The provided request was syntactically correct but the instruction was
        unable to

        be processed due to semantic errors.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
          example:
            error: unprocessable_content
            error_description: the request body was in the wrong format
            trace_id: 57bc14d9bd461f0b5a72db830149b67a
    internalServerErrorResponse:
      description: >-
        An unexpected or unhandled error occurred. This may be a transient error
        and

        may succeed on a retry.  If this isn't the case, please report it as an
        issue.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
          example:
            error: server_error
            error_description: failed to token claim
            trace_id: 57bc14d9bd461f0b5a72db830149b67a
  schemas:
    fileStorageId:
      description: A file storage ID.
      type: string
      format: uuid
    fileStorageDirectoryQuotaId:
      description: A File Storage Directory Quota ID.
      type: string
      format: uuid
    fileStorageDirectoryQuotaV2Update:
      description: A Directory Quota update request.
      type: object
      additionalProperties: false
      required:
        - metadata
        - spec
      properties:
        metadata:
          $ref: '#/components/schemas/resourceMetadata'
        spec:
          $ref: '#/components/schemas/fileStorageDirectoryQuotaV2UpdateSpec'
    fileStorageDirectoryQuotaV2Read:
      description: A File Storage Directory Quota.
      type: object
      required:
        - metadata
        - spec
        - status
      properties:
        metadata:
          $ref: '#/components/schemas/projectScopedResourceReadMetadata'
        spec:
          $ref: '#/components/schemas/fileStorageDirectoryQuotaV2Spec'
        status:
          $ref: '#/components/schemas/fileStorageDirectoryQuotaV2Status'
    error:
      description: Generic error message, compatible with oauth2.
      type: object
      required:
        - error
        - error_description
      properties:
        error:
          description: >-
            A terse error string expanding on the HTTP error code. Errors are
            based on the OAuth 2.02 specification, but are expanded with
            proprietary status codes for APIs other than those specified by
            OAuth 2.02.
          type: string
          enum:
            - invalid_request
            - server_error
            - access_denied
            - not_found
            - conflict
            - method_not_allowed
            - unsupported_media_type
            - request_entity_too_large
            - unprocessable_content
            - forbidden
        error_description:
          description: Verbose message describing the error.
          type: string
        trace_id:
          description: Unique trace identifier for the request.
          type: string
    resourceMetadata:
      description: Metadata required for all API resource reads and writes.
      required:
        - name
      properties:
        name:
          $ref: '#/components/schemas/kubernetesLabelValue'
        description:
          description: >-
            The resource description, this optionally augments the name with
            more context.
          type: string
        tags:
          $ref: '#/components/schemas/tagList'
    fileStorageDirectoryQuotaV2UpdateSpec:
      description: >-
        Directory Quota settings on update. The path cannot change, so it is not
        part of an update. At least one of directoryLimits, defaultUserLimits,
        defaultGroupLimits or a non-empty rules list is required; a request
        without any is rejected with 422. When directoryLimits is set, no
        default or rule limit may exceed it, compared separately for
        capacityBytes and inodes; a request that does is rejected with 422.
        directoryLimits.capacityBytes may not exceed the File Storage size.
        Quotas may be nested, and directoryLimits may not exceed the
        directoryLimits of a quota on a parent directory, nor be lower than
        those of a quota on a subdirectory, compared separately for
        capacityBytes and inodes. A request that breaks either rule is rejected
        with 422.
      type: object
      additionalProperties: false
      properties:
        directoryLimits:
          $ref: '#/components/schemas/fileStorageDirectoryQuotaLimits'
        defaultUserLimits:
          $ref: '#/components/schemas/fileStorageDirectoryQuotaLimits'
        defaultGroupLimits:
          $ref: '#/components/schemas/fileStorageDirectoryQuotaLimits'
        rules:
          $ref: '#/components/schemas/fileStorageDirectoryQuotaRules'
    projectScopedResourceReadMetadata:
      description: Metadata required by project scoped resource reads.
      allOf:
        - $ref: '#/components/schemas/organizationScopedResourceReadMetadata'
        - type: object
          required:
            - projectId
          properties:
            projectId:
              description: The project identifier the resource belongs to.
              type: string
    fileStorageDirectoryQuotaV2Spec:
      description: Directory Quota settings.
      type: object
      required:
        - fileStorageId
        - path
      properties:
        fileStorageId:
          $ref: '#/components/schemas/fileStorageId'
        path:
          $ref: '#/components/schemas/fileStorageDirectoryQuotaPath'
        directoryLimits:
          $ref: '#/components/schemas/fileStorageDirectoryQuotaLimits'
        defaultUserLimits:
          $ref: '#/components/schemas/fileStorageDirectoryQuotaLimits'
        defaultGroupLimits:
          $ref: '#/components/schemas/fileStorageDirectoryQuotaLimits'
        rules:
          $ref: '#/components/schemas/fileStorageDirectoryQuotaRules'
    fileStorageDirectoryQuotaV2Status:
      description: >-
        Observed Directory Quota state. Usage is refreshed periodically, so it
        lags writes. Usage is reported for the whole directory and for subjects
        with a rule only; subjects limited only by defaultUserLimits or
        defaultGroupLimits are not reported.
      type: object
      properties:
        usage:
          $ref: '#/components/schemas/fileStorageDirectoryQuotaDirectoryUsage'
        rules:
          description: >-
            Observed state of each spec rule, matched by subject. Rules are
            checked after the request is accepted, so an unknown user or group
            never fails the request; it shows as that rule's error.
          type: array
          items:
            $ref: '#/components/schemas/fileStorageDirectoryQuotaRuleStatus'
    kubernetesLabelValue:
      description: >-
        A valid Kubernetes label value, typically used for resource names that
        can be

        indexed in the database.
      type: string
      pattern: ^[0-9A-Za-z](?:[0-9A-Za-z-_.]{0,61}[0-9A-Za-z])?$
    tagList:
      description: A list of tags.
      type: array
      items:
        $ref: '#/components/schemas/tag'
    fileStorageDirectoryQuotaLimits:
      description: Hard limits. At least one of capacityBytes or inodes is required.
      type: object
      additionalProperties: false
      minProperties: 1
      properties:
        capacityBytes:
          description: Hard capacity limit in bytes.
          type: integer
          format: int64
          minimum: 1
          example: 10737418240
        inodes:
          description: Hard limit on the number of files and directories.
          type: integer
          format: int64
          minimum: 1
          example: 1000000
    fileStorageDirectoryQuotaRules:
      description: Per user and group hard limits. A subject appears at most once.
      type: array
      maxItems: 20
      items:
        $ref: '#/components/schemas/fileStorageDirectoryQuotaRule'
    organizationScopedResourceReadMetadata:
      description: Metadata required by organization scoped resource reads.
      allOf:
        - $ref: '#/components/schemas/resourceReadMetadata'
        - type: object
          required:
            - organizationId
          properties:
            organizationId:
              description: The organization identifier the resource belongs to.
              type: string
    fileStorageDirectoryQuotaPath:
      description: >-
        Immutable canonical directory path relative to the File Storage root.
        Empty, absolute, repeated or trailing slashes and exact dot or dot-dot
        components are rejected, so the root cannot be targeted. It is unique
        within the File Storage.
      type: string
      maxLength: 1024
      pattern: ^([^/]+/)*[^/]+$
      example: home/example-1
    fileStorageDirectoryQuotaDirectoryUsage:
      description: Observed usage of the whole directory tree.
      type: object
      properties:
        usedBytes:
          description: Used capacity in bytes.
          type: integer
          format: int64
          example: 2239325517172
        usedInodes:
          description: Used files and directories.
          type: integer
          format: int64
          example: 4169748
        updatedAt:
          description: When usage was last refreshed.
          type: string
          format: date-time
    fileStorageDirectoryQuotaRuleStatus:
      description: Observed state of one spec rule.
      type: object
      required:
        - subject
        - provisioningStatus
      properties:
        subject:
          $ref: '#/components/schemas/fileStorageDirectoryQuotaSubject'
        provisioningStatus:
          $ref: '#/components/schemas/resourceProvisioningStatus'
        message:
          description: Why the rule is in error. Only set when provisioningStatus is error.
          type: string
        usage:
          $ref: '#/components/schemas/fileStorageDirectoryQuotaUsage'
    tag:
      description: >-
        A tag mapping arbitrary names to values.  These have no special meaning

        for any component are are intended for use by end users to add
        additional

        context to a resource, for example to categorize it.
      type: object
      required:
        - name
        - value
      properties:
        name:
          description: A unique tag name.
          type: string
        value:
          description: The value of the tag.
          type: string
    fileStorageDirectoryQuotaRule:
      description: The hard limits of one user or group.
      type: object
      additionalProperties: false
      required:
        - subject
        - limits
      properties:
        subject:
          $ref: '#/components/schemas/fileStorageDirectoryQuotaSubject'
        limits:
          $ref: '#/components/schemas/fileStorageDirectoryQuotaLimits'
    resourceReadMetadata:
      description: Metadata required by all resource reads.
      allOf:
        - $ref: '#/components/schemas/staticResourceMetadata'
        - type: object
          required:
            - provisioningStatus
            - healthStatus
          properties:
            deletionTime:
              description: The time the resource was deleted.
              type: string
              format: date-time
            provisioningStatus:
              $ref: '#/components/schemas/resourceProvisioningStatus'
            provisioningStatusDetail:
              $ref: '#/components/schemas/provisioningStatusDetail'
            healthStatus:
              $ref: '#/components/schemas/resourceHealthStatus'
            healthStatusDetail:
              $ref: '#/components/schemas/healthStatusDetail'
    fileStorageDirectoryQuotaSubject:
      description: A user or group, identified by exactly one of name or id.
      type: object
      additionalProperties: false
      minProperties: 2
      maxProperties: 2
      required:
        - kind
      properties:
        kind:
          description: The kind of subject.
          type: string
          enum:
            - user
            - group
        name:
          description: The user or group name.
          type: string
          minLength: 1
          maxLength: 256
          example: user1
        id:
          description: The uid or gid.
          type: integer
          format: int64
          minimum: 0
          maximum: 4294967294
          example: 65534
    resourceProvisioningStatus:
      description: The provisioning state of a resource.
      type: string
      enum:
        - pending
        - provisioning
        - provisioned
        - deprovisioning
        - error
    fileStorageDirectoryQuotaUsage:
      description: Observed capacity and inode usage.
      type: object
      properties:
        usedBytes:
          description: Used capacity in bytes.
          type: integer
          format: int64
          example: 2239325517172
        usedInodes:
          description: Used files and directories.
          type: integer
          format: int64
          example: 4169748
    staticResourceMetadata:
      description: |
        This metadata is for resources that just exist, and don't require
        any provisioning and health status, but benefit from a standardized
        metadata format.
      type: object
      allOf:
        - $ref: '#/components/schemas/resourceMetadata'
        - type: object
          required:
            - id
            - creationTime
          properties:
            id:
              description: The unique resource ID.
              type: string
            creationTime:
              description: The time the resource was created.
              type: string
              format: date-time
            createdBy:
              description: The user who created the resource.
              type: string
            modifiedTime:
              description: The time a resource was updated.
              type: string
              format: date-time
            modifiedBy:
              description: The user who updated the resource.
              type: string
    provisioningStatusDetail:
      description: |-
        Human-facing detail about the current provisioning state: a
        machine-classifiable reason drawn from a closed vocabulary, and a
        user-safe human-readable message. Derived from the resource's status and
        supplements the coarse provisioningStatus; never stored.
      type: object
      required:
        - reason
        - message
      properties:
        reason:
          $ref: '#/components/schemas/provisioningStatusReason'
        message:
          description: A user-safe, human-readable description of the provisioning state.
          type: string
    resourceHealthStatus:
      description: The health state of a resource.
      type: string
      enum:
        - unknown
        - healthy
        - degraded
        - error
    healthStatusDetail:
      description: >-
        Human-facing detail about the current health state: a
        machine-classifiable

        reason drawn from a closed vocabulary, and a user-safe human-readable

        message (e.g. "2/12 nodes are down"). Derived from the resource's status
        and

        supplements the coarse healthStatus; never stored.
      type: object
      required:
        - reason
        - message
      properties:
        reason:
          $ref: '#/components/schemas/healthStatusReason'
        message:
          description: A user-safe, human-readable description of the health state.
          type: string
    provisioningStatusReason:
      description: |-
        A closed, generic classification of a resource's provisioning state,
        finer-grained than provisioningStatus. This vocabulary is owned by the
        platform and is the same across all resources; domain-specific state
        (e.g. an instance's lifecycle phase) is carried on other mechanisms and
        never appears here.
      type: string
      enum:
        - Provisioning
        - Provisioned
        - Errored
        - Deprovisioning
        - Deprovisioned
        - DependencyNotReady
        - DependencyFailed
        - DependencyNotFound
    healthStatusReason:
      description: >-
        A closed, generic classification of a resource's health — the raw health

        condition reason, finer-grained than the coarse healthStatus. Owned by
        the

        platform and the same across all resources.
      type: string
      enum:
        - Healthy
        - Degraded
        - Unknown
  securitySchemes:
    oauth2Authentication:
      description: Operation requires OAuth 2.0 bearer token authentication.
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://identity.nks.europe-west4.nscale.com/oauth2/v2/authorization
          tokenUrl: https://identity.nks.europe-west4.nscale.com/oauth2/v2/token
          scopes: {}

````