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

How can I get a list of policies #5

Open
MarkusFeldmann opened this issue May 24, 2022 · 6 comments
Open

How can I get a list of policies #5

MarkusFeldmann opened this issue May 24, 2022 · 6 comments

Comments

@MarkusFeldmann
Copy link

I tried to get workspaces created with a certain policy. When filtering by 'policyname' I get an exception that the policyname column property is not supported for filtering. So I tried to get the worspace filtered by the policyId, that works good. Is there a way to request the policies (name and id) from the service?

thanks a lot for you work.

Markus.

@Gamma-Chen-Avepoint
Copy link

Hi Markus,

Thank you for your using, we will publish a new API next week if everything goes well, It'll list all the possible values for supported columns.
I'll contact you again after published.

Thanks

Gamma

@MarkusFeldmann
Copy link
Author

Hi Gamma,

thanks a lot, that is great to hear.
Markus

@Gamma-Chen-Avepoint
Copy link

Hi Markus,

We have published a new version SDK, The newly api named GetWorkspaceFilters, you can find it in WorkspaceAdminApi.

Thanks

Gamma

@sear-lin-avepoint
Copy link
Collaborator

sear-lin-avepoint commented Jun 3, 2022

Hi @MarkusFeldmann
Except the GetWorkspaceFilters api, you can also get the policies (name and id) from the service, may I know which type of service you need get from?
below is the sample of how to get policies from create collection service and create group service:
https://github.com/AvePoint/cloud-governance-client/blob/main/example/csharp/netframework/Requests/CreateSite/CreateSite_AssignPolicy.cs

https://github.com/AvePoint/cloud-governance-client/blob/main/example/csharp/netframework/Requests/CreateGroup/CreateGroup_Policy.cs

@MarkusFeldmann
Copy link
Author

Hi @sear-lin-avepoint
thanks for the clarifications. I checked out the filters on the workspace class, I can use that to get filters for reports.
I also tried out to filter by policyName, that still does not work. It is not a problem for me, since I can get the policy Ids from the filters. But you might wanna look into it.

var wsFiltered = wsApi.GetWorkspaces(filter: "policyName eq 'name of policy'");

The message is:
Error calling GetWorkspaces: {"code":"InternalServerError","message":["Invalid column name 'PolicyName'."],"requestId":"0HMI7FQJACKIJ:00000005","date":"2022-06-07T07:52:35.4194708Z"}

I can work with the workspace.filters, because I get the policyId. This here works:
var wsFiltered = wsApi.GetWorkspaces(filter: "policyId eq {d461d78f-a343-4d81-bda1-0b8152b1cd9d}");
From the in-code documentation I would have expected, that I can filter by policyName.

anyway: thanks a lot.
best regards, Markus

@sear-lin-avepoint
Copy link
Collaborator

Hi @MarkusFeldmann
Thanks for your feedback, we're aware of this issue, you can use the workaround right now while we're trying to fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants