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

policyfile details API - required associated policy group list with name and no of total nodes in response #2647

Open
vinay033 opened this issue Jul 19, 2021 · 0 comments

Comments

@vinay033
Copy link

Describe the problem

Using the chef automate we are getting the details of the policy file, we required a list of policy groups with name and no of total nodes in response, we can create a separate API for that, or we can add as additional information with details API.

Replication Case

example like:
request:
https://api.chef-server.dev/organizations/pedant_testorg_api_19024/policies/example-policy. <--- example URL

response we need:

{
    "revision_id": "cc28026f9d52c8856a6d2963b001a60b0b3c0f2d0a7fc72b617c947be3b503bb",
    "name": "test1",
    "run_list": [
       "recipe[viv-test::default]"
    ],
    "included_policy_locks": [
        ....
    ],
    "cookbook_locks": {
        "nginx": {
        ....
        },
        "ohai": {
        ....
        },
        "viv-test": {
        ....
        }
    },
    "default_attributes": {
        ....
    },
    "override_attributes": {
        ....
    },
    "solution_dependencies": {
        ....
    },
    "policy_groups": [  <---------------------------------- policy groups
        {
            name: "test_policy_group",
            total_nodes: 2
        },
        {
            name: "test_policy_group1",
            total_nodes: 3
        }
    ]
}

Stacktrace

Possible Solution

we can also create a new API for the policy file groups
example
request - https://api.chef-server.dev/organizations/pedant_testorg_api_19024/policies/example-policy-name/policy_groups

response:

"policy_groups": [  <---------------------------------- policy groups
        {
            name: "test_policy_group",
            total_nodes: 2
        },
        {
            name: "test_policy_group1",
            total_nodes: 3
        }
    ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants