> ## 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.

# List networks

> List networks.



## OpenAPI

````yaml /openapi/region-openapi.yaml get /api/v2/networks
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: []
security: []
paths:
  /api/v2/networks:
    description: >-
      Manages region scoped layer 3 networks.  Networks by default come with a
      default route to

      the internet that performs masquerading.  This version of the API requires
      at least a

      /24 CIDR range.  A portion of the network may be reserved for
      infrastructure use such as

      file storage and internal platform requirements as directed by the
      infrastructure provider.
    get:
      tags:
        - Networks
      summary: List networks
      description: List networks.
      parameters:
        - $ref: '#/components/parameters/tagSelectorParameter'
        - $ref: '#/components/parameters/organizationIDQueryParameter'
        - $ref: '#/components/parameters/projectIDQueryParameter'
        - $ref: '#/components/parameters/regionIDQueryParameter'
      responses:
        '200':
          $ref: '#/components/responses/networksV2Response'
        '400':
          $ref: '#/components/responses/badRequestResponse'
        '401':
          $ref: '#/components/responses/unauthorizedResponse'
        '403':
          $ref: '#/components/responses/forbiddenResponse'
        '500':
          $ref: '#/components/responses/internalServerErrorResponse'
      security:
        - oauth2Authentication: []
components:
  parameters:
    tagSelectorParameter:
      name: tag
      in: query
      description: |-
        A set of tags to match against resources in the form "name=value",
        thus when encoded you get "?tag=foo%3Dcat&tag=bar%3Ddog".
      schema:
        type: array
        items:
          type: string
    organizationIDQueryParameter:
      name: organizationID
      in: query
      description: Allows resources to be filtered by organization.
      schema:
        type: array
        items:
          type: string
    projectIDQueryParameter:
      name: projectID
      in: query
      description: Allows resources to be filtered by project.
      schema:
        type: array
        items:
          type: string
    regionIDQueryParameter:
      name: regionID
      in: query
      description: Allows resources to be filtered by region.
      schema:
        type: array
        items:
          type: string
  responses:
    networksV2Response:
      description: A list of layer 3 networks.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/networksV2Read'
          example:
            - metadata:
                id: a64f9269-36e0-4312-b8d1-52d93d569b7b
                name: my-network
                organizationId: 9a8c6370-4065-4d4a-9da0-7678df40cd9d
                projectId: e36c058a-8eba-4f5b-91f4-f6ffb983795c
                creationTime: '2024-05-31T14:11:00Z'
                createdBy: john.doe@acme.com
                provisioningStatus: provisioned
                healthStatus: healthy
              spec:
                dnsNameservers:
                  - 8.8.8.8
              status:
                regionId: d891dbf0-0a01-4efc-ae3a-5d77f6d3424b
                prefix: 192.168.0.0/24
                reservations:
                  prefixLength: 25
                  providerReservedPrefixLength: 28
    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
    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:
    networksV2Read:
      description: A list of networks.
      type: array
      items:
        $ref: '#/components/schemas/networkV2Read'
    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
    networkV2Read:
      description: A network.
      type: object
      required:
        - metadata
        - spec
        - status
      properties:
        metadata:
          $ref: '#/components/schemas/projectScopedResourceReadMetadata'
        spec:
          $ref: '#/components/schemas/networkV2Spec'
        status:
          $ref: '#/components/schemas/networkV2Status'
    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
    networkV2Spec:
      description: A network's specification.
      type: object
      required:
        - dnsNameservers
      properties:
        dnsNameservers:
          $ref: '#/components/schemas/ipv4AddressList'
          description: |-
            DNS nameservers to use.  If empty this will use the platform's
            internal DNS server and allow hosts to resolve each other.  If it is
            populated then no internal host resolution will be possible.
        routes:
          $ref: '#/components/schemas/routes'
    networkV2Status:
      description: Read only status about a network.
      type: object
      required:
        - regionId
        - prefix
      properties:
        regionId:
          description: The region a network is provisioned in.
          type: string
        prefix:
          description: An IPv4 prefix for the network.
          type: string
        reservations:
          $ref: '#/components/schemas/networkReservations'
    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
    ipv4AddressList:
      description: A list of IPv4 addresses.
      type: array
      items:
        $ref: '#/components/schemas/ipv4Address'
    routes:
      description: A list of network routes.
      type: array
      items:
        $ref: '#/components/schemas/route'
    networkReservations:
      description: |-
        Network reservations carve a prefix from the start of the network CIDR
        for infrastructure use such as file storage and internal platform
        services as directed by the infrastructure provider.
        For example, on a /24 network a reservation prefix length of 25
        reserves 192.168.0.0/25, leaving 192.168.0.128-192.168.0.254 for DHCP.
        Reservations are fixed when the network is created and are immutable
        afterwards.
      type: object
      required:
        - prefixLength
      properties:
        prefixLength:
          description: |-
            Defines how much of the network to reserve, starting at the
            beginning of the network CIDR.  For example, on a /24 network a
            value of 25 reserves the lower half of the network, i.e.
            192.168.0.0/25.  The network address (.0) and gateway (.1) are
            platform-reserved within that space, so usable reserved addresses
            begin at .2.  The reservation prefix length must be greater than
            the network prefix length.
          type: integer
          minimum: 0
          maximum: 30
        providerReservedPrefixLength:
          description: >-
            Optionally carves a prefix from the start of the reserved space for

            provider use.

            For example, on a /24 network with prefixLength=25 and

            providerReservedPrefixLength=28, 192.168.0.0/28 is reserved for

            provider use and storage uses the remainder of the reserved space,

            192.168.0.16-192.168.0.127. If this matches prefixLength, the full

            reservation is treated as provider-reserved space and no storage
            range

            is left.
          type: integer
          minimum: 0
          maximum: 30
    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'
            healthStatus:
              $ref: '#/components/schemas/resourceHealthStatus'
    ipv4Address:
      description: An IPv4 address.
      type: string
      format: ipv4
    route:
      description: A network route.
      type: object
      required:
        - prefix
        - nexthop
      properties:
        prefix:
          description: An IPv4 prefix for the route.
          type: string
        nexthop:
          description: An IPv4 address for the route's next hop.
          type: string
    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
    resourceProvisioningStatus:
      description: The provisioning state of a resource.
      type: string
      enum:
        - unknown
        - pending
        - provisioning
        - provisioned
        - deprovisioning
        - error
    resourceHealthStatus:
      description: The health state of a resource.
      type: string
      enum:
        - unknown
        - healthy
        - degraded
        - error
    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'
    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'
    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
  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: {}

````