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

# Get router metrics

> Get the network traffic of each router interface, in bits and packets per second.



## OpenAPI

````yaml /api-reference/services_docs_mintlify_enriched/cloud_api.yaml post /cloud/v1/routers/{project_id}/{region_id}/{router_id}/metrics
openapi: 3.1.0
info:
  title: Gcore OpenAPI – Cloud API
  description: >-
    This OpenAPI is an aggregated OpenAPI specification that unifies all Gcore
    products into a single file. It covers Cloud, CDN, DNS, WAAP, DDoS
    Protection, Object Storage, Streaming, and FastEdge services.
  version: 273c478ddeaa
servers:
  - url: https://api.gcore.com
security:
  - APIKey: []
tags:
  - name: Bare Metal
  - name: Container as a Service
  - name: Cost Reports
  - name: DDoS Protection
  - name: Everywhere Inference
  - name: Everywhere Inference Apps
  - name: File Shares
  - name: Floating IPs
  - name: Function as a Service
  - name: GPU Bare Metal
  - name: GPU Virtual
  - name: IP Ranges
  - name: Images
  - name: Instances
  - name: Load Balancers
  - name: Logging
  - name: Managed Kubernetes
  - name: Managed PostgreSQL
  - name: Networks
  - name: Placement Groups
  - name: Ports
  - name: Pricing
  - name: Projects
  - name: Quotas
  - name: Regions
  - name: Registry
  - name: Reservations
  - name: Reserved IPs
  - name: Routers
  - name: SSH Keys
  - name: Secrets
  - name: Security Groups
  - name: Snapshot Schedules
  - name: Snapshots
  - name: Tasks
  - name: User Actions
  - name: User Role Assignments
  - name: Volumes
paths:
  /cloud/v1/routers/{project_id}/{region_id}/{router_id}/metrics:
    post:
      tags:
        - Routers
      summary: Get router metrics
      description: >-
        Get the network traffic of each router interface, in bits and packets
        per second.
      operationId: RouterMetricsViewSet.post
      parameters:
        - in: path
          name: project_id
          required: true
          description: Project ID
          schema:
            description: Project ID
            example: 1
            examples:
              - 1
            title: Project Id
            type: integer
        - in: path
          name: region_id
          required: true
          description: Region ID
          schema:
            description: Region ID
            example: 1
            examples:
              - 1
            title: Region Id
            type: integer
        - in: path
          name: router_id
          required: true
          description: Router ID
          schema:
            description: Router ID
            example: ccd5b925-e35c-4611-a511-67ab503104c8
            examples:
              - ccd5b925-e35c-4611-a511-67ab503104c8
            format: uuid4
            title: Router Id
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RouterMetricsRequestSerializer'
      responses:
        '200':
          description: Router metrics
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RouterMetricsCollectionSerializer'
components:
  schemas:
    RouterMetricsRequestSerializer:
      properties:
        time_interval:
          description: Time interval
          example: 6
          examples:
            - 6
          title: Time Interval
          type: integer
        time_unit:
          $ref: '#/components/schemas/InstanceMetricsTimeUnitEnum'
          description: Time interval unit
          examples:
            - hour
      required:
        - time_interval
        - time_unit
      title: RouterMetricsRequestSerializer
      type: object
    RouterMetricsCollectionSerializer:
      properties:
        count:
          description: Number of objects
          example: 1
          examples:
            - 1
          minimum: 0
          title: Count
          type: integer
        results:
          description: Objects
          items:
            $ref: '#/components/schemas/RouterInterfaceMetricsSerializer'
          title: Results
          type: array
      required:
        - count
        - results
      title: RouterMetricsCollectionSerializer
      type: object
    InstanceMetricsTimeUnitEnum:
      enum:
        - day
        - hour
      title: InstanceMetricsTimeUnitEnum
      type: string
    RouterInterfaceMetricsSerializer:
      properties:
        interface_type:
          $ref: '#/components/schemas/RouterInterfaceType'
          description: >-
            Interface type. The public interface includes the router gateway and
            the floating IPs. A private interface connects the router to a
            subnet.
          examples:
            - public
        ip_addresses:
          description: IP addresses of the port
          example:
            - 10.0.0.1
          examples:
            - - 10.0.0.1
          items:
            format: ipvanyaddress
            type: string
          title: Ip Addresses
          type: array
        metrics:
          description: Traffic metrics of the interface, in order of time
          items:
            $ref: '#/components/schemas/RouterMetricPointSerializer'
          title: Metrics
          type: array
        network_id:
          description: Network ID
          example: ccd5b925-e35c-4611-a511-67ab503104c8
          examples:
            - ccd5b925-e35c-4611-a511-67ab503104c8
          format: uuid4
          title: Network Id
          type: string
        port_id:
          description: Port ID
          example: 013e399e-a9f1-4b5c-9e2d-3f4a5b6c7d8e
          examples:
            - 013e399e-a9f1-4b5c-9e2d-3f4a5b6c7d8e
          format: uuid4
          title: Port Id
          type: string
      required:
        - interface_type
        - port_id
        - network_id
        - ip_addresses
        - metrics
      title: RouterInterfaceMetricsSerializer
      type: object
    RouterInterfaceType:
      enum:
        - private
        - public
      title: RouterInterfaceType
      type: string
    RouterMetricPointSerializer:
      properties:
        network_bps_egress:
          anyOf:
            - type: number
            - type: 'null'
          description: Network out, bits per second. Null when no data point is available.
          examples:
            - 816
          title: Network Bps Egress
        network_bps_ingress:
          anyOf:
            - type: number
            - type: 'null'
          description: Network in, bits per second. Null when no data point is available.
          examples:
            - 816
          title: Network Bps Ingress
        network_pps_egress:
          anyOf:
            - type: number
            - type: 'null'
          description: >-
            Network out, packets per second. Null when no data point is
            available.
          examples:
            - 0.7
          title: Network Pps Egress
        network_pps_ingress:
          anyOf:
            - type: number
            - type: 'null'
          description: >-
            Network in, packets per second. Null when no data point is
            available.
          examples:
            - 0.7
          title: Network Pps Ingress
        time:
          description: Timestamp
          example: '2020-07-07T12:57:00Z'
          examples:
            - '2020-07-07T12:57:00Z'
          title: Time
          type: string
      required:
        - time
        - network_bps_ingress
        - network_bps_egress
        - network_pps_ingress
        - network_pps_egress
      title: RouterMetricPointSerializer
      type: object
  securitySchemes:
    APIKey:
      description: >-
        API key for authentication. Make sure to include the word `apikey`,
        followed by a single space and then your token.

        Example: `apikey 1234_abcdef`
      type: apiKey
      in: header
      name: Authorization

````