Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document org policy violations REST API #12556

Merged
merged 1 commit into from
Aug 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions content/docs/pulumi-cloud/cloud-rest-api/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3193,6 +3193,62 @@ Status: 200 OK
```
<!-- ###################################################################### -->

## Policy Results

### List Policy Violations

```
GET /api/orgs/{organization}/policyresults/violations
```

#### Parameters

| Parameter | Type | In | Description |
|---------------------|--------|-------|--------------------------------------------------------------------------------------------------------------|
| `organization` | string | path | organization name |

#### Example

```bash
curl \
-H "Accept: application/vnd.pulumi+8" \
-H "Content-Type: application/json" \
-H "Authorization: token $PULUMI_ACCESS_TOKEN" \
https://api.pulumi.com/api/orgs/{organization}/policyresults/violations
```

#### Default response

```
Status: 200 OK
```

```
{
"continuationToken": "",
"policyViolations": [
{
"level": "advisory",
"message": "Checks that Kubernetes Pods are not being used directly.
Kubernetes Pods should not be used directly. Instead, you may want to use a Deployment, ReplicaSet or Job.
",
"observedAt": "2024-08-20T20:59:41Z",
"policyName": "pods-are-prohibited",
"policyPack": "kubernetes",
"policyPackTag": "0.0.2",
"projectName": "pulumi-k8s-test",
"resourceName": "pod-test",
"resourceType": "kubernetes:core/v1:Pod",
"resourceURN": "urn:pulumi:dev::pulumi-k8s-test::kubernetes:core/v1:Pod::pod-test",
"stackName": "dev",
"updateVersion": 7
}
]
}
```

<!-- ###################################################################### -->

## Environments

{{< notes >}}
Expand Down
Loading