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

# List nodes

> List all nodes on this cluster.

Client must be logged in as a user with admin privileges.



## OpenAPI

````yaml /openapi/cluster-api-v2.json get /nodes/
openapi: 3.0.0
info:
  description: >-
    REST API for querying information about CockroachDB cluster health, nodes,
    ranges,

    sessions, and other meta information. For additional details, see
    cockroachlabs.com/docs/stable/cluster-api.
  title: CockroachDB v2 API
  license:
    name: Business Source License
  version: '2.0'
  x-logo:
    url: https://www.cockroachlabs.com/docs/images/cockroachlabs-logo-170.png
    backgroundColor: '#FFFFFF'
    altText: Cockroach Labs logo
servers:
  - url: https://localhost/api/v2
  - url: http://localhost/api/v2
security: []
paths:
  /nodes/:
    get:
      summary: List nodes
      description: |-
        List all nodes on this cluster.

        Client must be logged in as a user with admin privileges.
      operationId: listNodes
      parameters:
        - description: Maximum number of results to return in this call.
          name: limit
          in: query
          schema:
            type: integer
        - description: Continuation offset for results after a past limited run.
          name: offset
          in: query
          schema:
            type: integer
      responses:
        '200':
          description: List nodes response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/nodesResponse'
      security:
        - api_session: []
      x-codeSamples:
        - lang: curl
          source: |-
            curl --request GET \
              --url 'https://localhost/api/v2/nodes/?limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE' \
              --header 'X-Cockroach-API-Session: REPLACE_KEY_VALUE'
components:
  schemas:
    nodesResponse:
      type: object
      title: Response struct for listNodes.
      properties:
        next:
          description: >-
            Continuation offset for the next paginated call, if more values are
            present.

            Specify as the `offset` parameter.
          type: integer
          format: int64
          x-go-name: Next
        nodes:
          description: Status of nodes.
          type: array
          items:
            $ref: '#/components/schemas/nodeStatus'
          x-go-name: Nodes
      x-go-package: github.com/cockroachdb/cockroach/pkg/server
    nodeStatus:
      type: object
      title: Status about a node.
      properties:
        ServerVersion:
          $ref: '#/components/schemas/Version'
        address:
          $ref: '#/components/schemas/UnresolvedAddr'
        attrs:
          $ref: '#/components/schemas/Attributes'
        build_tag:
          description: An internal build marker.
          type: string
          x-go-name: BuildTag
        cluster_name:
          description: The string name of this cluster, if set.
          type: string
          x-go-name: ClusterName
        liveness_status:
          description: |-
            The status of the node from the perspective of the
            liveness subsystem. For internal use only.
          type: integer
          format: int32
          x-go-name: LivenessStatus
        locality:
          $ref: '#/components/schemas/Locality'
        metrics:
          description: Contains the last sampled metrics for this node.
          type: object
          additionalProperties:
            type: number
            format: double
          x-go-name: Metrics
        node_id:
          description: The integer ID of this node.
          type: integer
          format: int32
          x-go-name: NodeID
        num_cpus:
          description: The number of CPUs on this node.
          type: integer
          format: int32
          x-go-name: NumCpus
        sql_address:
          $ref: '#/components/schemas/UnresolvedAddr'
        started_at:
          description: |-
            The time when this node was started, expressed as
            nanoseconds since Unix epoch.
          type: integer
          format: int64
          x-go-name: StartedAt
        total_system_memory:
          description: |-
            The total amount of available system memory on this
            node (or container), in bytes.
          type: integer
          format: int64
          x-go-name: TotalSystemMemory
        updated_at:
          description: |-
            The time at which the node status record was last updated,
            in nanoseconds since Unix epoch.
          type: integer
          format: int64
          x-go-name: UpdatedAt
      x-go-package: github.com/cockroachdb/cockroach/pkg/server
    Version:
      type: object
      properties:
        internal:
          description: >-
            The internal version is used to introduce migrations during the
            development

            cycle. They are subversions that are never the end versions of a
            release,

            i.e., users of stable, public release will only use binaries with
            the

            internal version set to 0.
          type: integer
          format: int32
          x-go-name: Internal
        major_val:
          type: integer
          format: int32
          x-go-name: Major
        minor_val:
          type: integer
          format: int32
          x-go-name: Minor
        patch:
          description: Note that patch is a placeholder and will always be zero.
          type: integer
          format: int32
          x-go-name: Patch
      x-go-package: github.com/cockroachdb/cockroach/pkg/roachpb
    UnresolvedAddr:
      type: object
      title: An unresolved version of net.Addr.
      properties:
        address_field:
          description: IP address on the network (e.g., 192.168.1.1).
          type: string
          x-go-name: AddressField
        network_field:
          description: Type of network (e.g., TCP, TCP4, TCP6).
          type: string
          x-go-name: NetworkField
      x-go-package: github.com/cockroachdb/cockroach/pkg/util
    Attributes:
      description: |-
        Attributes specifies a list of arbitrary strings describing
        node topology, store type, and machine capabilities.
      type: object
      properties:
        attrs:
          type: array
          items:
            type: string
          x-go-name: Attrs
      x-go-package: github.com/cockroachdb/cockroach/pkg/roachpb
    Locality:
      description: |-
        An ordered set of key value Tiers that describe a node's
        location. The tier keys should be the same across all nodes.
      type: object
      properties:
        tiers:
          type: array
          items:
            $ref: '#/components/schemas/Tier'
          x-go-name: Tiers
      x-go-package: github.com/cockroachdb/cockroach/pkg/roachpb
    Tier:
      type: object
      title: Tier represents one level of the locality hierarchy.
      properties:
        key:
          description: Key is the name of tier and should match all other nodes.
          type: string
          x-go-name: Key
        value:
          description: Value is node specific value corresponding to the key.
          type: string
          x-go-name: Value
      x-go-package: github.com/cockroachdb/cockroach/pkg/roachpb
  securitySchemes:
    api_session:
      description: >-
        Token for logged-in REST session. Use `/login/` to log in and get a
        session token. For additional information, see
        cockroachlabs.com/docs/stable/cluster-api.
      type: apiKey
      name: X-Cockroach-API-Session
      in: header

````