Juniper Networks Network Policies API

Network policy rules for traffic control between virtual networks.

Documentation

Specifications

Schemas & Data

Other Resources

OpenAPI Specification

juniper-networks-network-policies-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Juniper Networks Juniper Apstra Intent-Based Networking Alarms Network Policies API
  description: RESTful API for Juniper Apstra, an intent-based networking platform for automating data center network design, deployment, and operations. Apstra abstracts network infrastructure into design blueprints with logical models, rack types, templates, and connectivity. The platform continuously validates that the network state matches the intended configuration and raises anomalies when deviations occur. The API provides full access to design resources, blueprints, device management, telemetry, and IBA (Intent-Based Analytics) probes. Authentication uses token-based sessions obtained via the login endpoint.
  version: '4.2'
  contact:
    name: Juniper Networks Support
    url: https://www.juniper.net/documentation/product/us/en/juniper-apstra/
  license:
    name: Proprietary
    url: https://www.juniper.net/us/en/legal-notices.html
servers:
- url: https://{apstra_server}/api
  description: Apstra server API endpoint.
  variables:
    apstra_server:
      description: Hostname or IP address of the Apstra server.
      default: apstra.example.com
security:
- authToken: []
tags:
- name: Network Policies
  description: Network policy rules for traffic control between virtual networks.
paths:
  /network-policys:
    get:
      operationId: listNetworkPolicies
      summary: Juniper Networks List network policies
      description: Returns all network policies. Network policies define rules that control traffic flow between virtual networks, including allow, deny, and service chain actions.
      tags:
      - Network Policies
      responses:
        '200':
          description: Network policies returned.
          content:
            application/json:
              schema:
                type: object
                properties:
                  network-policys:
                    type: array
                    items:
                      $ref: '#/components/schemas/ObjectRef'
        '401':
          $ref: '#/components/responses/Unauthorized'
    post:
      operationId: createNetworkPolicy
      summary: Juniper Networks Create network policy
      description: Creates a new network policy with traffic control rules.
      tags:
      - Network Policies
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                network-policy:
                  $ref: '#/components/schemas/NetworkPolicy'
      responses:
        '200':
          description: Network policy created.
          content:
            application/json:
              schema:
                type: object
                properties:
                  network-policy:
                    $ref: '#/components/schemas/NetworkPolicy'
        '400':
          $ref: '#/components/responses/BadRequest'
components:
  responses:
    BadRequest:
      description: Invalid request parameters.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Authentication required or token expired.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Error:
      type: object
      properties:
        message:
          type: string
    ObjectRef:
      type: object
      properties:
        href:
          type: string
          format: uri
          description: Resource URL.
        fq_name:
          type: array
          items:
            type: string
          description: Fully qualified name path (domain, project, name).
        uuid:
          type: string
          format: uuid
          description: Object UUID.
    NetworkPolicy:
      type: object
      properties:
        uuid:
          type: string
          format: uuid
        fq_name:
          type: array
          items:
            type: string
        network_policy_entries:
          type: object
          properties:
            policy_rule:
              type: array
              items:
                type: object
                properties:
                  direction:
                    type: string
                    enum:
                    - '>'
                    - <>
                    description: Traffic direction (unidirectional or bidirectional).
                  protocol:
                    type: string
                    description: IP protocol (tcp, udp, icmp, any).
                  action_list:
                    type: object
                    properties:
                      simple_action:
                        type: string
                        enum:
                        - pass
                        - deny
                      apply_service:
                        type: array
                        items:
                          type: string
                        description: Service chain instance FQN list.
                  src_addresses:
                    type: array
                    items:
                      type: object
                      properties:
                        virtual_network:
                          type: string
                        security_group:
                          type: string
                        subnet:
                          type: object
                          properties:
                            ip_prefix:
                              type: string
                            ip_prefix_len:
                              type: integer
                  dst_addresses:
                    type: array
                    items:
                      type: object
                      properties:
                        virtual_network:
                          type: string
                        security_group:
                          type: string
                  src_ports:
                    type: array
                    items:
                      type: object
                      properties:
                        start_port:
                          type: integer
                        end_port:
                          type: integer
                  dst_ports:
                    type: array
                    items:
                      type: object
                      properties:
                        start_port:
                          type: integer
                        end_port:
                          type: integer
  securitySchemes:
    authToken:
      type: apiKey
      in: header
      name: AuthToken
      description: Authentication token obtained from POST /api/aaa/login. Include in the AuthToken header for all authenticated API requests.