StackRox NetworkPolicyService API

The NetworkPolicyService API from StackRox — 9 operation(s) for networkpolicyservice.

Operations 9

GET /v1/networkpolicies Get network policies #
POST /v1/networkpolicies/apply/{clusterId} Apply network policy #
GET /v1/networkpolicies/cluster/{clusterId} Get network graph #
GET /v1/networkpolicies/generate/{clusterId} Generate network policies #
GET /v1/networkpolicies/graph/epoch Get network graph epoch #
POST /v1/networkpolicies/simulate/{clusterId} Simulate network graph #
POST /v1/networkpolicies/simulate/{clusterId}/notify Send network policy YAML #
GET /v1/networkpolicies/undo/{clusterId} Get undo modification #
GET /v1/networkpolicies/{id} Get network policy #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/stackrox-networkpolicyservice-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

stackrox-networkpolicyservice-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Reference Network Policy Service API
  version: '1'
  description: API reference for the StackRox Kubernetes Security Platform (upstream of Red Hat Advanced Cluster Security). Provides risk analysis, visibility, runtime alerts, policy management, compliance checking, and vulnerability management for containerized workloads. Authentication uses API tokens generated via /v1/apitokens/generate and passed as Bearer tokens.
  contact:
    email: support@stackrox.com
    url: https://www.stackrox.io/
  license:
    name: All Rights Reserved
    url: https://www.stackrox.com/
servers:
- url: https://{central-host}
  description: StackRox Central API server
  variables:
    central-host:
      default: stackrox.localhost
      description: StackRox Central hostname or IP
security:
- ApiToken: []
tags:
- name: NetworkPolicyService
paths:
  /v1/networkpolicies:
    get:
      operationId: GetNetworkPolicies
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1NetworkPoliciesResponse'
      parameters:
      - name: clusterId
        in: query
        required: false
        schema:
          type: string
      - name: deploymentQuery
        in: query
        required: false
        schema:
          type: string
      tags:
      - NetworkPolicyService
      summary: Get network policies
      x-summary-source: derived
  /v1/networkpolicies/apply/{clusterId}:
    post:
      operationId: ApplyNetworkPolicy
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1Empty'
      parameters:
      - name: clusterId
        in: path
        required: true
        schema:
          type: string
      requestBody:
        $ref: '#/components/requestBodies/storageNetworkPolicyModification'
      tags:
      - NetworkPolicyService
      summary: Apply network policy
      x-summary-source: derived
  /v1/networkpolicies/cluster/{clusterId}:
    get:
      operationId: GetNetworkGraph
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1NetworkGraph'
      parameters:
      - name: clusterId
        in: path
        required: true
        schema:
          type: string
      - name: query
        in: query
        required: false
        schema:
          type: string
      tags:
      - NetworkPolicyService
      summary: Get network graph
      x-summary-source: derived
  /v1/networkpolicies/generate/{clusterId}:
    get:
      operationId: GenerateNetworkPolicies
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1GenerateNetworkPoliciesResponse'
      parameters:
      - name: clusterId
        in: path
        required: true
        schema:
          type: string
      - name: query
        in: query
        required: false
        schema:
          type: string
      - name: deleteExisting
        in: query
        required: false
        schema:
          type: string
          enum:
          - UNKNOWN
          - NONE
          - GENERATED_ONLY
          - ALL
          default: UNKNOWN
      - name: networkDataSince
        in: query
        required: false
        schema:
          type: string
          format: date-time
      tags:
      - NetworkPolicyService
      summary: Generate network policies
      x-summary-source: derived
  /v1/networkpolicies/graph/epoch:
    get:
      operationId: GetNetworkGraphEpoch
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1NetworkGraphEpoch'
      parameters:
      - name: clusterId
        in: query
        required: false
        schema:
          type: string
      tags:
      - NetworkPolicyService
      summary: Get network graph epoch
      x-summary-source: derived
  /v1/networkpolicies/simulate/{clusterId}:
    post:
      operationId: SimulateNetworkGraph
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1SimulateNetworkGraphResponse'
      parameters:
      - name: clusterId
        in: path
        required: true
        schema:
          type: string
      requestBody:
        $ref: '#/components/requestBodies/storageNetworkPolicyModification'
      tags:
      - NetworkPolicyService
      summary: Simulate network graph
      x-summary-source: derived
  /v1/networkpolicies/simulate/{clusterId}/notify:
    post:
      operationId: SendNetworkPolicyYAML
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1Empty'
      parameters:
      - name: clusterId
        in: path
        required: true
        schema:
          type: string
      requestBody:
        $ref: '#/components/requestBodies/storageNetworkPolicyModification'
      tags:
      - NetworkPolicyService
      summary: Send network policy YAML
      x-summary-source: derived
  /v1/networkpolicies/undo/{clusterId}:
    get:
      operationId: GetUndoModification
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1GetUndoModificationResponse'
      parameters:
      - name: clusterId
        in: path
        required: true
        schema:
          type: string
      tags:
      - NetworkPolicyService
      summary: Get undo modification
      x-summary-source: derived
  /v1/networkpolicies/{id}:
    get:
      operationId: GetNetworkPolicy
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/storageNetworkPolicy'
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
      tags:
      - NetworkPolicyService
      summary: Get network policy
      x-summary-source: derived
components:
  schemas:
    v1GenerateNetworkPoliciesResponse:
      type: object
      properties:
        modification:
          $ref: '#/components/schemas/storageNetworkPolicyModification'
      title: 'Next available tag: 2'
    v1NetworkPolicyInSimulation:
      type: object
      properties:
        policy:
          $ref: '#/components/schemas/storageNetworkPolicy'
        status:
          $ref: '#/components/schemas/v1NetworkPolicyInSimulationStatus'
        oldPolicy:
          $ref: '#/components/schemas/storageNetworkPolicy'
    storageNetworkPolicyModification:
      type: object
      properties:
        applyYaml:
          type: string
        toDelete:
          type: array
          items:
            $ref: '#/components/schemas/storageNetworkPolicyReference'
      title: 'Next available tag: 3'
    storageNetworkPolicyApplicationUndoRecord:
      type: object
      properties:
        user:
          type: string
        applyTimestamp:
          type: string
          format: date-time
        originalModification:
          $ref: '#/components/schemas/storageNetworkPolicyModification'
        undoModification:
          $ref: '#/components/schemas/storageNetworkPolicyModification'
    v1NetworkNode:
      type: object
      properties:
        entity:
          $ref: '#/components/schemas/storageNetworkEntityInfo'
        internetAccess:
          type: boolean
          format: boolean
        policyIds:
          type: array
          items:
            type: string
        nonIsolatedIngress:
          type: boolean
          format: boolean
        nonIsolatedEgress:
          type: boolean
          format: boolean
        outEdges:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/v1NetworkEdgePropertiesBundle'
    storageNetworkPolicyReference:
      type: object
      properties:
        namespace:
          type: string
        name:
          type: string
      title: 'Next available tag: 3'
    storageLabelSelector:
      type: object
      properties:
        matchLabels:
          type: object
          additionalProperties:
            type: string
          description: This is actually a oneof, but we can't make it one due to backwards compatibility constraints.
        requirements:
          type: array
          items:
            $ref: '#/components/schemas/LabelSelectorRequirement'
      title: 'Next available tag: 3'
    storageLabelSelectorOperator:
      type: string
      enum:
      - UNKNOWN
      - IN
      - NOT_IN
      - EXISTS
      - NOT_EXISTS
      default: UNKNOWN
    storageNetworkEntityInfoType:
      type: string
      enum:
      - UNKNOWN_TYPE
      - DEPLOYMENT
      - INTERNET
      default: UNKNOWN_TYPE
    v1NetworkPolicyInSimulationStatus:
      type: string
      enum:
      - INVALID
      - UNCHANGED
      - MODIFIED
      - ADDED
      - DELETED
      default: INVALID
    v1GetUndoModificationResponse:
      type: object
      properties:
        undoRecord:
          $ref: '#/components/schemas/storageNetworkPolicyApplicationUndoRecord'
    storageNetworkPolicySpec:
      type: object
      properties:
        podSelector:
          $ref: '#/components/schemas/storageLabelSelector'
        ingress:
          type: array
          items:
            $ref: '#/components/schemas/storageNetworkPolicyIngressRule'
        egress:
          type: array
          items:
            $ref: '#/components/schemas/storageNetworkPolicyEgressRule'
        policyTypes:
          type: array
          items:
            $ref: '#/components/schemas/storageNetworkPolicyType'
    v1NetworkPoliciesResponse:
      type: object
      properties:
        networkPolicies:
          type: array
          items:
            $ref: '#/components/schemas/storageNetworkPolicy'
    storageNetworkPolicyEgressRule:
      type: object
      properties:
        ports:
          type: array
          items:
            $ref: '#/components/schemas/storageNetworkPolicyPort'
        to:
          type: array
          items:
            $ref: '#/components/schemas/storageNetworkPolicyPeer'
    storageNetworkPolicyIngressRule:
      type: object
      properties:
        ports:
          type: array
          items:
            $ref: '#/components/schemas/storageNetworkPolicyPort'
        from:
          type: array
          items:
            $ref: '#/components/schemas/storageNetworkPolicyPeer'
    v1Empty:
      type: object
    storageNetworkPolicyType:
      type: string
      enum:
      - UNSET_NETWORK_POLICY_TYPE
      - INGRESS_NETWORK_POLICY_TYPE
      - EGRESS_NETWORK_POLICY_TYPE
      default: UNSET_NETWORK_POLICY_TYPE
    storageIPBlock:
      type: object
      properties:
        cidr:
          type: string
        except:
          type: array
          items:
            type: string
    v1NetworkNodeDiff:
      type: object
      properties:
        policyIds:
          type: array
          items:
            type: string
        outEdges:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/v1NetworkEdgePropertiesBundle'
        nonIsolatedIngress:
          type: boolean
          format: boolean
        nonIsolatedEgress:
          type: boolean
          format: boolean
    v1NetworkEdgePropertiesBundle:
      type: object
      properties:
        properties:
          type: array
          items:
            $ref: '#/components/schemas/v1NetworkEdgeProperties'
    v1NetworkGraph:
      type: object
      properties:
        epoch:
          type: integer
          format: int64
        nodes:
          type: array
          items:
            $ref: '#/components/schemas/v1NetworkNode'
    v1NetworkEdgeProperties:
      type: object
      properties:
        port:
          type: integer
          format: int64
        protocol:
          $ref: '#/components/schemas/storageL4Protocol'
        lastActiveTimestamp:
          type: string
          format: date-time
    storageNetworkPolicyPort:
      type: object
      properties:
        protocol:
          $ref: '#/components/schemas/storageProtocol'
        port:
          type: integer
          format: int32
    storageL4Protocol:
      type: string
      enum:
      - L4_PROTOCOL_UNKNOWN
      - L4_PROTOCOL_TCP
      - L4_PROTOCOL_UDP
      - L4_PROTOCOL_ICMP
      - L4_PROTOCOL_RAW
      default: L4_PROTOCOL_UNKNOWN
    v1SimulateNetworkGraphResponse:
      type: object
      properties:
        simulatedGraph:
          $ref: '#/components/schemas/v1NetworkGraph'
        policies:
          type: array
          items:
            $ref: '#/components/schemas/v1NetworkPolicyInSimulation'
        added:
          $ref: '#/components/schemas/v1NetworkGraphDiff'
        removed:
          $ref: '#/components/schemas/v1NetworkGraphDiff'
    v1NetworkGraphDiff:
      type: object
      properties:
        nodeDiffs:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/v1NetworkNodeDiff'
    storageNetworkPolicy:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        clusterId:
          type: string
        clusterName:
          type: string
        namespace:
          type: string
        labels:
          type: object
          additionalProperties:
            type: string
        annotations:
          type: object
          additionalProperties:
            type: string
        spec:
          $ref: '#/components/schemas/storageNetworkPolicySpec'
        yaml:
          type: string
        apiVersion:
          type: string
        created:
          type: string
          format: date-time
    storageNetworkEntityInfoDeployment:
      type: object
      properties:
        name:
          type: string
        namespace:
          type: string
        cluster:
          type: string
    storageProtocol:
      type: string
      enum:
      - UNSET_PROTOCOL
      - TCP_PROTOCOL
      - UDP_PROTOCOL
      default: UNSET_PROTOCOL
    storageNetworkPolicyPeer:
      type: object
      properties:
        podSelector:
          $ref: '#/components/schemas/storageLabelSelector'
        namespaceSelector:
          $ref: '#/components/schemas/storageLabelSelector'
        ipBlock:
          $ref: '#/components/schemas/storageIPBlock'
    v1NetworkGraphEpoch:
      type: object
      properties:
        epoch:
          type: integer
          format: int64
    storageNetworkEntityInfo:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/storageNetworkEntityInfoType'
        id:
          type: string
        deployment:
          $ref: '#/components/schemas/storageNetworkEntityInfoDeployment'
    LabelSelectorRequirement:
      type: object
      properties:
        key:
          type: string
        op:
          $ref: '#/components/schemas/storageLabelSelectorOperator'
        values:
          type: array
          items:
            type: string
      title: 'Next available tag: 4'
  requestBodies:
    storageNetworkPolicyModification:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/storageNetworkPolicyModification'
      required: true
  securitySchemes:
    ApiToken:
      type: apiKey
      in: header
      name: Authorization
      description: 'StackRox API token. Format: Bearer {token}'