create Networking V1Namespaced Network Policy
POST {{baseUrl}}/apis/networking.k8s.io/v1/namespaces/:namespace/networkpolicies?dryRun=<string>&fieldManager=<string>&fieldValidation=<string>&pretty=<string>
create a NetworkPolicy
Request Params
Key | Datatype | Required | Description |
---|---|---|---|
dryRun | string | When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed | |
fieldManager | string | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. | |
fieldValidation | string | fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. | |
pretty | string | If 'true', then the output is pretty printed. |
Request Body
{"apiVersion"=>"<string>", "kind"=>"<string>", "metadata"=>{"annotations"=>{"proident59"=>"<string>", "mollit_11"=>"<string>", "ullamco_e"=>"<string>", "Excepteur_5"=>"<string>"}, "creationTimestamp"=>"<dateTime>", "deletionGracePeriodSeconds"=>"<long>", "deletionTimestamp"=>"<dateTime>", "finalizers"=>["<string>", "<string>"], "generateName"=>"<string>", "generation"=>"<long>", "labels"=>{"doloref5"=>"<string>"}, "managedFields"=>[{"apiVersion"=>"<string>", "fieldsType"=>"<string>", "manager"=>"<string>", "operation"=>"<string>", "subresource"=>"<string>", "time"=>"<dateTime>"}, {"apiVersion"=>"<string>", "fieldsType"=>"<string>", "manager"=>"<string>", "operation"=>"<string>", "subresource"=>"<string>", "time"=>"<dateTime>"}], "name"=>"<string>", "namespace"=>"<string>", "ownerReferences"=>[{"apiVersion"=>"<string>", "kind"=>"<string>", "name"=>"<string>", "uid"=>"<string>", "blockOwnerDeletion"=>"<boolean>", "controller"=>"<boolean>"}, {"apiVersion"=>"<string>", "kind"=>"<string>", "name"=>"<string>", "uid"=>"<string>", "blockOwnerDeletion"=>"<boolean>", "controller"=>"<boolean>"}], "resourceVersion"=>"<string>", "selfLink"=>"<string>", "uid"=>"<string>"}, "spec"=>{"podSelector"=>{"matchExpressions"=>[{"key"=>"<string>", "operator"=>"<string>", "values"=>["<string>", "<string>"]}, {"key"=>"<string>", "operator"=>"<string>", "values"=>["<string>", "<string>"]}], "matchLabels"=>{"sitb66"=>"<string>"}}, "egress"=>[{"ports"=>[{"endPort"=>"<integer>", "port"=>"<string>", "protocol"=>"<string>"}, {"endPort"=>"<integer>", "port"=>"<string>", "protocol"=>"<string>"}], "to"=>[{"ipBlock"=>{"cidr"=>"<string>", "except"=>["<string>", "<string>"]}, "namespaceSelector"=>{"matchExpressions"=>[{"key"=>"<string>", "operator"=>"<string>", "values"=>["<string>", "<string>"]}, {"key"=>"<string>", "operator"=>"<string>", "values"=>["<string>", "<string>"]}], "matchLabels"=>{"adipisicing_3"=>"<string>", "enim324"=>"<string>"}}, "podSelector"=>{"matchExpressions"=>[{"key"=>"<string>", "operator"=>"<string>", "values"=>["<string>", "<string>"]}, {"key"=>"<string>", "operator"=>"<string>", "values"=>["<string>", "<string>"]}], "matchLabels"=>{"ex8d9"=>"<string>", "essea2"=>"<string>"}}}, {"ipBlock"=>{"cidr"=>"<string>", "except"=>["<string>", "<string>"]}, "namespaceSelector"=>{"matchExpressions"=>[{"key"=>"<string>", "operator"=>"<string>", "values"=>["<string>", "<string>"]}, {"key"=>"<string>", "operator"=>"<string>", "values"=>["<string>", "<string>"]}], "matchLabels"=>{"elit_821"=>"<string>"}}, "podSelector"=>{"matchExpressions"=>[{"key"=>"<string>", "operator"=>"<string>", "values"=>["<string>", "<string>"]}, {"key"=>"<string>", "operator"=>"<string>", "values"=>["<string>", "<string>"]}], "matchLabels"=>{"minim_75"=>"<string>"}}}]}, {"ports"=>[{"endPort"=>"<integer>", "port"=>"<string>", "protocol"=>"<string>"}, {"endPort"=>"<integer>", "port"=>"<string>", "protocol"=>"<string>"}], "to"=>[{"ipBlock"=>{"cidr"=>"<string>", "except"=>["<string>", "<string>"]}, "namespaceSelector"=>{"matchExpressions"=>[{"key"=>"<string>", "operator"=>"<string>", "values"=>["<string>", "<string>"]}, {"key"=>"<string>", "operator"=>"<string>", "values"=>["<string>", "<string>"]}], "matchLabels"=>{"non_74f"=>"<string>"}}, "podSelector"=>{"matchExpressions"=>[{"key"=>"<string>", "operator"=>"<string>", "values"=>["<string>", "<string>"]}, {"key"=>"<string>", "operator"=>"<string>", "values"=>["<string>", "<string>"]}], "matchLabels"=>{"utd92"=>"<string>"}}}, {"ipBlock"=>{"cidr"=>"<string>", "except"=>["<string>", "<string>"]}, "namespaceSelector"=>{"matchExpressions"=>[{"key"=>"<string>", "operator"=>"<string>", "values"=>["<string>", "<string>"]}, {"key"=>"<string>", "operator"=>"<string>", "values"=>["<string>", "<string>"]}], "matchLabels"=>{"utd"=>"<string>"}}, "podSelector"=>{"matchExpressions"=>[{"key"=>"<string>", "operator"=>"<string>", "values"=>["<string>", "<string>"]}, {"key"=>"<string>", "operator"=>"<string>", "values"=>["<string>", "<string>"]}], "matchLabels"=>{"eu5f"=>"<string>"}}}]}], "ingress"=>[{"from"=>[{"ipBlock"=>{"cidr"=>"<string>", "except"=>["<string>", "<string>"]}, "namespaceSelector"=>{"matchExpressions"=>[{"key"=>"<string>", "operator"=>"<string>", "values"=>["<string>", "<string>"]}, {"key"=>"<string>", "operator"=>"<string>", "values"=>["<string>", "<string>"]}], "matchLabels"=>{"dolore_9c5"=>"<string>"}}, "podSelector"=>{"matchExpressions"=>[{"key"=>"<string>", "operator"=>"<string>", "values"=>["<string>", "<string>"]}, {"key"=>"<string>", "operator"=>"<string>", "values"=>["<string>", "<string>"]}], "matchLabels"=>{"este7"=>"<string>", "enim_e"=>"<string>", "nisi_2"=>"<string>", "in_c5"=>"<string>"}}}, {"ipBlock"=>{"cidr"=>"<string>", "except"=>["<string>", "<string>"]}, "namespaceSelector"=>{"matchExpressions"=>[{"key"=>"<string>", "operator"=>"<string>", "values"=>["<string>", "<string>"]}, {"key"=>"<string>", "operator"=>"<string>", "values"=>["<string>", "<string>"]}], "matchLabels"=>{"dolorf50"=>"<string>"}}, "podSelector"=>{"matchExpressions"=>[{"key"=>"<string>", "operator"=>"<string>", "values"=>["<string>", "<string>"]}, {"key"=>"<string>", "operator"=>"<string>", "values"=>["<string>", "<string>"]}], "matchLabels"=>{"magnaf"=>"<string>", "velit_aee"=>"<string>", "amet_3b7"=>"<string>", "nulla_850"=>"<string>"}}}], "ports"=>[{"endPort"=>"<integer>", "port"=>"<string>", "protocol"=>"<string>"}, {"endPort"=>"<integer>", "port"=>"<string>", "protocol"=>"<string>"}]}, {"from"=>[{"ipBlock"=>{"cidr"=>"<string>", "except"=>["<string>", "<string>"]}, "namespaceSelector"=>{"matchExpressions"=>[{"key"=>"<string>", "operator"=>"<string>", "values"=>["<string>", "<string>"]}, {"key"=>"<string>", "operator"=>"<string>", "values"=>["<string>", "<string>"]}], "matchLabels"=>{"sint_8_"=>"<string>", "amet_6c"=>"<string>"}}, "podSelector"=>{"matchExpressions"=>[{"key"=>"<string>", "operator"=>"<string>", "values"=>["<string>", "<string>"]}, {"key"=>"<string>", "operator"=>"<string>", "values"=>["<string>", "<string>"]}], "matchLabels"=>{"Excepteurcd"=>"<string>", "proident_9"=>"<string>"}}}, {"ipBlock"=>{"cidr"=>"<string>", "except"=>["<string>", "<string>"]}, "namespaceSelector"=>{"matchExpressions"=>[{"key"=>"<string>", "operator"=>"<string>", "values"=>["<string>", "<string>"]}, {"key"=>"<string>", "operator"=>"<string>", "values"=>["<string>", "<string>"]}], "matchLabels"=>{"minim6"=>"<string>", "animf2"=>"<string>"}}, "podSelector"=>{"matchExpressions"=>[{"key"=>"<string>", "operator"=>"<string>", "values"=>["<string>", "<string>"]}, {"key"=>"<string>", "operator"=>"<string>", "values"=>["<string>", "<string>"]}], "matchLabels"=>{"dolore_d6b"=>"<string>", "laborum_a"=>"<string>"}}}], "ports"=>[{"endPort"=>"<integer>", "port"=>"<string>", "protocol"=>"<string>"}, {"endPort"=>"<integer>", "port"=>"<string>", "protocol"=>"<string>"}]}], "policyTypes"=>["<string>", "<string>"]}}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Content-Type | string | ||
Accept | string |
RESPONSES
status: Created
{"apiVersion":"\u003cstring\u003e","kind":"\u003cstring\u003e","metadata":{"annotations":{"proident59":"\u003cstring\u003e","mollit_11":"\u003cstring\u003e","ullamco_e":"\u003cstring\u003e","Excepteur_5":"\u003cstring\u003e"},"creationTimestamp":"\u003cdateTime\u003e","deletionGracePeriodSeconds":"\u003clong\u003e","deletionTimestamp":"\u003cdateTime\u003e","finalizers":["\u003cstring\u003e","\u003cstring\u003e"],"generateName":"\u003cstring\u003e","generation":"\u003clong\u003e","labels":{"doloref5":"\u003cstring\u003e"},"managedFields":[{"apiVersion":"\u003cstring\u003e","fieldsType":"\u003cstring\u003e","fieldsV1":{},"manager":"\u003cstring\u003e","operation":"\u003cstring\u003e","subresource":"\u003cstring\u003e","time":"\u003cdateTime\u003e"},{"apiVersion":"\u003cstring\u003e","fieldsType":"\u003cstring\u003e","fieldsV1":{},"manager":"\u003cstring\u003e","operation":"\u003cstring\u003e","subresource":"\u003cstring\u003e","time":"\u003cdateTime\u003e"}],"name":"\u003cstring\u003e","namespace":"\u003cstring\u003e","ownerReferences":[{"apiVersion":"\u003cstring\u003e","kind":"\u003cstring\u003e","name":"\u003cstring\u003e","uid":"\u003cstring\u003e","blockOwnerDeletion":"\u003cboolean\u003e","controller":"\u003cboolean\u003e"},{"apiVersion":"\u003cstring\u003e","kind":"\u003cstring\u003e","name":"\u003cstring\u003e","uid":"\u003cstring\u003e","blockOwnerDeletion":"\u003cboolean\u003e","controller":"\u003cboolean\u003e"}],"resourceVersion":"\u003cstring\u003e","selfLink":"\u003cstring\u003e","uid":"\u003cstring\u003e"},"spec":{"podSelector":{"matchExpressions":[{"key":"\u003cstring\u003e","operator":"\u003cstring\u003e","values":["\u003cstring\u003e","\u003cstring\u003e"]},{"key":"\u003cstring\u003e","operator":"\u003cstring\u003e","values":["\u003cstring\u003e","\u003cstring\u003e"]}],"matchLabels":{"sitb66":"\u003cstring\u003e"}},"egress":[{"ports":[{"endPort":"\u003cinteger\u003e","port":"\u003cstring\u003e","protocol":"\u003cstring\u003e"},{"endPort":"\u003cinteger\u003e","port":"\u003cstring\u003e","protocol":"\u003cstring\u003e"}],"to":[{"ipBlock":{"cidr":"\u003cstring\u003e","except":["\u003cstring\u003e","\u003cstring\u003e"]},"namespaceSelector":{"matchExpressions":[{"key":"\u003cstring\u003e","operator":"\u003cstring\u003e","values":["\u003cstring\u003e","\u003cstring\u003e"]},{"key":"\u003cstring\u003e","operator":"\u003cstring\u003e","values":["\u003cstring\u003e","\u003cstring\u003e"]}],"matchLabels":{"adipisicing_3":"\u003cstring\u003e","enim324":"\u003cstring\u003e"}},"podSelector":{"matchExpressions":[{"key":"\u003cstring\u003e","operator":"\u003cstring\u003e","values":["\u003cstring\u003e","\u003cstring\u003e"]},{"key":"\u003cstring\u003e","operator":"\u003cstring\u003e","values":["\u003cstring\u003e","\u003cstring\u003e"]}],"matchLabels":{"ex8d9":"\u003cstring\u003e","essea2":"\u003cstring\u003e"}}},{"ipBlock":{"cidr":"\u003cstring\u003e","except":["\u003cstring\u003e","\u003cstring\u003e"]},"namespaceSelector":{"matchExpressions":[{"key":"\u003cstring\u003e","operator":"\u003cstring\u003e","values":["\u003cstring\u003e","\u003cstring\u003e"]},{"key":"\u003cstring\u003e","operator":"\u003cstring\u003e","values":["\u003cstring\u003e","\u003cstring\u003e"]}],"matchLabels":{"elit_821":"\u003cstring\u003e"}},"podSelector":{"matchExpressions":[{"key":"\u003cstring\u003e","operator":"\u003cstring\u003e","values":["\u003cstring\u003e","\u003cstring\u003e"]},{"key":"\u003cstring\u003e","operator":"\u003cstring\u003e","values":["\u003cstring\u003e","\u003cstring\u003e"]}],"matchLabels":{"minim_75":"\u003cstring\u003e"}}}]},{"ports":[{"endPort":"\u003cinteger\u003e","port":"\u003cstring\u003e","protocol":"\u003cstring\u003e"},{"endPort":"\u003cinteger\u003e","port":"\u003cstring\u003e","protocol":"\u003cstring\u003e"}],"to":[{"ipBlock":{"cidr":"\u003cstring\u003e","except":["\u003cstring\u003e","\u003cstring\u003e"]},"namespaceSelector":{"matchExpressions":[{"key":"\u003cstring\u003e","operator":"\u003cstring\u003e","values":["\u003cstring\u003e","\u003cstring\u003e"]},{"key":"\u003cstring\u003e","operator":"\u003cstring\u003e","values":["\u003cstring\u003e","\u003cstring\u003e"]}],"matchLabels":{"non_74f":"\u003cstring\u003e"}},"podSelector":{"matchExpressions":[{"key":"\u003cstring\u003e","operator":"\u003cstring\u003e","values":["\u003cstring\u003e","\u003cstring\u003e"]},{"key":"\u003cstring\u003e","operator":"\u003cstring\u003e","values":["\u003cstring\u003e","\u003cstring\u003e"]}],"matchLabels":{"utd92":"\u003cstring\u003e"}}},{"ipBlock":{"cidr":"\u003cstring\u003e","except":["\u003cstring\u003e","\u003cstring\u003e"]},"namespaceSelector":{"matchExpressions":[{"key":"\u003cstring\u003e","operator":"\u003cstring\u003e","values":["\u003cstring\u003e","\u003cstring\u003e"]},{"key":"\u003cstring\u003e","operator":"\u003cstring\u003e","values":["\u003cstring\u003e","\u003cstring\u003e"]}],"matchLabels":{"utd":"\u003cstring\u003e"}},"podSelector":{"matchExpressions":[{"key":"\u003cstring\u003e","operator":"\u003cstring\u003e","values":["\u003cstring\u003e","\u003cstring\u003e"]},{"key":"\u003cstring\u003e","operator":"\u003cstring\u003e","values":["\u003cstring\u003e","\u003cstring\u003e"]}],"matchLabels":{"eu5f":"\u003cstring\u003e"}}}]}],"ingress":[{"from":[{"ipBlock":{"cidr":"\u003cstring\u003e","except":["\u003cstring\u003e","\u003cstring\u003e"]},"namespaceSelector":{"matchExpressions":[{"key":"\u003cstring\u003e","operator":"\u003cstring\u003e","values":["\u003cstring\u003e","\u003cstring\u003e"]},{"key":"\u003cstring\u003e","operator":"\u003cstring\u003e","values":["\u003cstring\u003e","\u003cstring\u003e"]}],"matchLabels":{"dolore_9c5":"\u003cstring\u003e"}},"podSelector":{"matchExpressions":[{"key":"\u003cstring\u003e","operator":"\u003cstring\u003e","values":["\u003cstring\u003e","\u003cstring\u003e"]},{"key":"\u003cstring\u003e","operator":"\u003cstring\u003e","values":["\u003cstring\u003e","\u003cstring\u003e"]}],"matchLabels":{"este7":"\u003cstring\u003e","enim_e":"\u003cstring\u003e","nisi_2":"\u003cstring\u003e","in_c5":"\u003cstring\u003e"}}},{"ipBlock":{"cidr":"\u003cstring\u003e","except":["\u003cstring\u003e","\u003cstring\u003e"]},"namespaceSelector":{"matchExpressions":[{"key":"\u003cstring\u003e","operator":"\u003cstring\u003e","values":["\u003cstring\u003e","\u003cstring\u003e"]},{"key":"\u003cstring\u003e","operator":"\u003cstring\u003e","values":["\u003cstring\u003e","\u003cstring\u003e"]}],"matchLabels":{"dolorf50":"\u003cstring\u003e"}},"podSelector":{"matchExpressions":[{"key":"\u003cstring\u003e","operator":"\u003cstring\u003e","values":["\u003cstring\u003e","\u003cstring\u003e"]},{"key":"\u003cstring\u003e","operator":"\u003cstring\u003e","values":["\u003cstring\u003e","\u003cstring\u003e"]}],"matchLabels":{"magnaf":"\u003cstring\u003e","velit_aee":"\u003cstring\u003e","amet_3b7":"\u003cstring\u003e","nulla_850":"\u003cstring\u003e"}}}],"ports":[{"endPort":"\u003cinteger\u003e","port":"\u003cstring\u003e","protocol":"\u003cstring\u003e"},{"endPort":"\u003cinteger\u003e","port":"\u003cstring\u003e","protocol":"\u003cstring\u003e"}]},{"from":[{"ipBlock":{"cidr":"\u003cstring\u003e","except":["\u003cstring\u003e","\u003cstring\u003e"]},"namespaceSelector":{"matchExpressions":[{"key":"\u003cstring\u003e","operator":"\u003cstring\u003e","values":["\u003cstring\u003e","\u003cstring\u003e"]},{"key":"\u003cstring\u003e","operator":"\u003cstring\u003e","values":["\u003cstring\u003e","\u003cstring\u003e"]}],"matchLabels":{"sint_8_":"\u003cstring\u003e","amet_6c":"\u003cstring\u003e"}},"podSelector":{"matchExpressions":[{"key":"\u003cstring\u003e","operator":"\u003cstring\u003e","values":["\u003cstring\u003e","\u003cstring\u003e"]},{"key":"\u003cstring\u003e","operator":"\u003cstring\u003e","values":["\u003cstring\u003e","\u003cstring\u003e"]}],"matchLabels":{"Excepteurcd":"\u003cstring\u003e","proident_9":"\u003cstring\u003e"}}},{"ipBlock":{"cidr":"\u003cstring\u003e","except":["\u003cstring\u003e","\u003cstring\u003e"]},"namespaceSelector":{"matchExpressions":[{"key":"\u003cstring\u003e","operator":"\u003cstring\u003e","values":["\u003cstring\u003e","\u003cstring\u003e"]},{"key":"\u003cstring\u003e","operator":"\u003cstring\u003e","values":["\u003cstring\u003e","\u003cstring\u003e"]}],"matchLabels":{"minim6":"\u003cstring\u003e","animf2":"\u003cstring\u003e"}},"podSelector":{"matchExpressions":[{"key":"\u003cstring\u003e","operator":"\u003cstring\u003e","values":["\u003cstring\u003e","\u003cstring\u003e"]},{"key":"\u003cstring\u003e","operator":"\u003cstring\u003e","values":["\u003cstring\u003e","\u003cstring\u003e"]}],"matchLabels":{"dolore_d6b":"\u003cstring\u003e","laborum_a":"\u003cstring\u003e"}}}],"ports":[{"endPort":"\u003cinteger\u003e","port":"\u003cstring\u003e","protocol":"\u003cstring\u003e"},{"endPort":"\u003cinteger\u003e","port":"\u003cstring\u003e","protocol":"\u003cstring\u003e"}]}],"policyTypes":["\u003cstring\u003e","\u003cstring\u003e"]}}