VMware Cloud Community
rmjstn
Contributor
Contributor
Jump to solution

"Filter is not valid for API" while creating a Tier

Hello,

I use the network-insight-sdk-python SDK to create Applications and Tiers. I can't create a Tier with a filter on the Application name (it's OK from the UI). 

I associated an issue to the SDK project, but I think my problem is related to misuse of the filter property.

I couldn't find the data model to use to build filters. This page simply indicates that it is a string.

When I create a Tier via the UI and display the result I've got this :

 

 'group_membership_criteria': [{'ip_address_membership_criteria': None,
                                'membership_type': 'SearchMembershipCriteria',
                                'search_membership_criteria': {'entity_type': 'BaseVirtualMachine',
                                                               'filter': 'application '
                                                                         '= '
                                                                         "'Gitlab'"}}],

 

If I pass this filter to the API, I've got this error :

 

HTTP response body: {"code":400,"message":"Filter is not valid for API","details":[]}

 

Thanks

Rémy

 

Reply
0 Kudos
1 Solution

Accepted Solutions
smitmartijn
VMware Employee
VMware Employee
Jump to solution

Hi,

Unfortunately, the filter currently only allows for specific VMs, IPsets, or security groups. The application property isn't available in the API, while it is there in the UI.

View solution in original post

Reply
0 Kudos
2 Replies
smitmartijn
VMware Employee
VMware Employee
Jump to solution

Hi,

Unfortunately, the filter currently only allows for specific VMs, IPsets, or security groups. The application property isn't available in the API, while it is there in the UI.

Reply
0 Kudos
rmjstn
Contributor
Contributor
Jump to solution

Hi @smitmartijn ,

Thanks for your answer, it saves me hours of searching... 😉

Rémy

Reply
0 Kudos