Create a policy. [experimental]
Create a policy. [experimental]
Create a policy for a specific workload type based on the provided specification.
Authentication
AuthorizationBearer
Bearer authentication
Request
This endpoint expects an object.
workloadType
Specifies the Group, Version, and Kind (GVK) of the Kubernetes resource that defines the workload.
scope
Allowed values:
description
A description of the policy.
clusterId
The id of the cluster the policy applies to. Required when the scope is cluster.
departmentId
The id of the department the policy applies to. Required when the scope is department.
projectId
The id of the project the policy applies to. Required when the scope is project.
rules
The rules declared on this policy. Each rule targets a field in the workload spec and constrains its allowed values through its enforcements.
Response
The created policy.
createdAt
The timestamp for when the policy was created.
createdBy
Identifier of the user who created the policy.
id
The unique identifier for the policy.
scope
Allowed values:
updatedAt
The timestamp for when the policy was last updated.
updatedBy
Identifier of the user who last updated the policy.
workloadType
Specifies the Group, Version, and Kind (GVK) of the Kubernetes resource that defines the workload.
clusterId
The id of the cluster the policy applies to. Required when the scope is cluster.
departmentId
The id of the department the policy applies to. Required when the scope is department.
description
A description of the policy.
effectiveRules
The merged rule set in effect for this policy, including rules inherited from broader scopes (cluster, then department, then project). Each entry adds the sourceOfRule indicating where the rule was defined. Returned in responses only; not accepted in requests.
projectId
The id of the project the policy applies to. Required when the scope is project.
rules
The rules declared on this policy. Each rule targets a field in the workload spec and constrains its allowed values through its enforcements.
status
Configuration issues detected by the server for this policy. Returned in responses only; not accepted in requests.
Errors
400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
503
Service Unavailable Error