Skip to content

Commit

Permalink
Merge pull request #906 from CircleCI-Public/SNC-200
Browse files Browse the repository at this point in the history
(SNC-200) Update docs for policy command
  • Loading branch information
rooneyshuman authored Apr 11, 2023
2 parents 9f3c378 + bc3c012 commit 29170d6
Show file tree
Hide file tree
Showing 13 changed files with 14 additions and 73 deletions.
14 changes: 7 additions & 7 deletions cmd/policy/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ This group of commands allows the management of polices to be verified against b
return nil
},
Args: cobra.ExactArgs(1),
Example: `policy push ./policies --owner-id 462d67f8-b232-4da4-a7de-0c86dd667d3f`,
Example: `circleci policy push ./policies --owner-id 462d67f8-b232-4da4-a7de-0c86dd667d3f`,
}

cmd.Flags().StringVar(&context, "context", "config", "policy context")
Expand Down Expand Up @@ -127,7 +127,7 @@ This group of commands allows the management of polices to be verified against b
return prettyJSONEncoder(cmd.OutOrStdout()).Encode(diff)
},
Args: cobra.ExactArgs(1),
Example: `policy diff ./policies --owner-id 462d67f8-b232-4da4-a7de-0c86dd667d3f`,
Example: `circleci policy diff ./policies --owner-id 462d67f8-b232-4da4-a7de-0c86dd667d3f`,
}
cmd.Flags().StringVar(&context, "context", "config", "policy context")
cmd.Flags().StringVar(&ownerID, "owner-id", "", "the id of the policy's owner")
Expand Down Expand Up @@ -159,7 +159,7 @@ This group of commands allows the management of polices to be verified against b
return nil
},
Args: cobra.MaximumNArgs(1),
Example: `policy fetch --owner-id 516425b2-e369-421b-838d-920e1f51b0f5`,
Example: `circleci policy fetch --owner-id 516425b2-e369-421b-838d-920e1f51b0f5`,
}

cmd.Flags().StringVar(&context, "context", "config", "policy context")
Expand Down Expand Up @@ -238,7 +238,7 @@ This group of commands allows the management of polices to be verified against b
return nil
},
Args: cobra.MaximumNArgs(1),
Example: `policy logs --owner-id 462d67f8-b232-4da4-a7de-0c86dd667d3f --after 2022/03/14 --out output.json`,
Example: `circleci policy logs --owner-id 462d67f8-b232-4da4-a7de-0c86dd667d3f --after 2022/03/14 --out output.json`,
}

cmd.Flags().StringVar(&request.Status, "status", "", "filter decision logs based on their status")
Expand Down Expand Up @@ -313,7 +313,7 @@ This group of commands allows the management of polices to be verified against b
return nil
},
Args: cobra.MaximumNArgs(1),
Example: `policy decide ./policies --input ./.circleci/config.yml`,
Example: `circleci policy decide ./policies --input ./.circleci/config.yml`,
}

cmd.Flags().StringVar(&ownerID, "owner-id", "", "the id of the policy's owner")
Expand Down Expand Up @@ -359,7 +359,7 @@ This group of commands allows the management of polices to be verified against b
return nil
},
Args: cobra.ExactArgs(1),
Example: `policy eval ./policies --input ./.circleci/config.yml`,
Example: `circleci policy eval ./policies --input ./.circleci/config.yml`,
}

cmd.Flags().StringVar(&inputPath, "input", "", "path to input file")
Expand Down Expand Up @@ -406,7 +406,7 @@ This group of commands allows the management of polices to be verified against b
return nil
},
Args: cobra.ExactArgs(0),
Example: `policy settings --enabled=true`,
Example: `circleci policy settings --owner-id 462d67f8-b232-4da4-a7de-0c86dd667d3f --enabled=true`,
}

cmd.Flags().StringVar(&ownerID, "owner-id", "", "the id of the policy's owner")
Expand Down
13 changes: 0 additions & 13 deletions cmd/policy/testdata/policy/create-expected-usage.txt

This file was deleted.

2 changes: 1 addition & 1 deletion cmd/policy/testdata/policy/decide-expected-usage.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Usage:
policy decide [policy_file_or_dir_path] [flags]

Examples:
policy decide ./policies --input ./.circleci/config.yml
circleci policy decide ./policies --input ./.circleci/config.yml

Flags:
--context string policy context for decision (default "config")
Expand Down
11 changes: 0 additions & 11 deletions cmd/policy/testdata/policy/delete-expected-usage.txt

This file was deleted.

2 changes: 1 addition & 1 deletion cmd/policy/testdata/policy/diff-expected-usage.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Usage:
policy diff <policy_dir_path> [flags]

Examples:
policy diff ./policies --owner-id 462d67f8-b232-4da4-a7de-0c86dd667d3f
circleci policy diff ./policies --owner-id 462d67f8-b232-4da4-a7de-0c86dd667d3f

Flags:
--context string policy context (default "config")
Expand Down
2 changes: 1 addition & 1 deletion cmd/policy/testdata/policy/eval-expected-usage.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Usage:
policy eval <policy_file_or_dir_path> [flags]

Examples:
policy eval ./policies --input ./.circleci/config.yml
circleci policy eval ./policies --input ./.circleci/config.yml

Flags:
--input string path to input file
Expand Down
2 changes: 1 addition & 1 deletion cmd/policy/testdata/policy/fetch-expected-usage.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Usage:
policy fetch [policy_name] [flags]

Examples:
policy fetch --owner-id 516425b2-e369-421b-838d-920e1f51b0f5
circleci policy fetch --owner-id 516425b2-e369-421b-838d-920e1f51b0f5

Flags:
--context string policy context (default "config")
Expand Down
11 changes: 0 additions & 11 deletions cmd/policy/testdata/policy/get-expected-usage.txt

This file was deleted.

11 changes: 0 additions & 11 deletions cmd/policy/testdata/policy/list-expected-usage.txt

This file was deleted.

2 changes: 1 addition & 1 deletion cmd/policy/testdata/policy/logs-expected-usage.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Usage:
policy logs [decision_id] [flags]

Examples:
policy logs --owner-id 462d67f8-b232-4da4-a7de-0c86dd667d3f --after 2022/03/14 --out output.json
circleci policy logs --owner-id 462d67f8-b232-4da4-a7de-0c86dd667d3f --after 2022/03/14 --out output.json

Flags:
--after string filter decision logs triggered AFTER this datetime
Expand Down
2 changes: 1 addition & 1 deletion cmd/policy/testdata/policy/push-expected-usage.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Usage:
policy push <policy_dir_path> [flags]

Examples:
policy push ./policies --owner-id 462d67f8-b232-4da4-a7de-0c86dd667d3f
circleci policy push ./policies --owner-id 462d67f8-b232-4da4-a7de-0c86dd667d3f

Flags:
--context string policy context (default "config")
Expand Down
2 changes: 1 addition & 1 deletion cmd/policy/testdata/policy/settings-expected-usage.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Usage:
policy settings [flags]

Examples:
policy settings --enabled=true
circleci policy settings --owner-id 462d67f8-b232-4da4-a7de-0c86dd667d3f --enabled=true

Flags:
--context string policy context for decision (default "config")
Expand Down
13 changes: 0 additions & 13 deletions cmd/policy/testdata/policy/update-expected-usage.txt

This file was deleted.

0 comments on commit 29170d6

Please sign in to comment.