Skip to content
Proud to collaborate with Microsoft for Startups

kubernetes.networkpolicy.get ​

Read a single NetworkPolicy (full spec included)

Reads a single NetworkPolicy from the cluster.

If the NetworkPolicy exists, returns it serialised via api_client.sanitize_for_serialization alongside exists=True. If it is not found (404), returns exists=False and networkpolicy=None — no exception is raised.

The full object is returned rather than a summary because the caller of a policy read is usually a drift check: it needs to compare the live rules against the declared ones field-for-field, and a projection would hide the difference it is looking for. Use kubernetes.networkpolicy.list when a namespace overview is enough.

Inputs:

  • connection_uuid: UUID of the cloud connection (required)
  • namespace: Namespace the NetworkPolicy lives in (required)
  • name: NetworkPolicy name (required)

Outputs:

  • exists: bool — True when the NetworkPolicy was found
  • networkpolicy: JSON — full V1NetworkPolicy serialised for transport, or null

Plugin required: context.get_plugin("connection").kubernetes_runner_clients(connection_uuid, organization_uuid) must expose networking_v1 with read_namespaced_network_policy and api_client with sanitize_for_serialization.

Overview ​

PropertyValue
Workflow typeAtomic
LibraryApp-kubernetes
Version1.0

Input Schema ​

FieldTypeRequiredDefaultDescription
connection_uuiduuidYes——
namespacestringYes——
namestringYes——
organization_uuiduuidNo——

Output Schema ​

FieldTypeRequiredDefaultDescription
connection_uuiduuidNo——
organization_uuiduuidNo——
namespacestringNo——
namestringNo——
existsbooleanNo——
apiVersionstringNo——
kindstringNo——
metadatajsonNo——
specjsonNo——
statusjsonNo——
datajsonNo——
binaryDatajsonNo——
stringDatajsonNo——
immutablebooleanNo——
typestringNo——
rulesjsonNo——
aggregationRulejsonNo——
roleRefjsonNo——
subjectsjsonNo——
failure_reasonstringNo——
failure_typestringNo——
failed_actionstringNo——
failed_at_statestringNo——
failed_stepstringNo——
failed_layerstringNo——
errorstringNo——
error_typestringNo——

States ​

StateInitialTerminalSuccessAuto-advanceDescription
pendingYesNo—execute—
completedNoYesYes——
failedNoYesNo——

State Diagram ​

Transitions ​

FromActionToDescription
pendingexecutecompleted—
* (any state)failfailed—

API Usage ​

bash
POST /api/workflows/start
Content-Type: application/json

{
  "workflow_type": "kubernetes.networkpolicy.get",
  "initial_data": {
    "connection_uuid": "value",
    "namespace": "value",
    "name": "value"
  }
}