Skip to content

feat(apps): Add Generate App Manifest functionality #244

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

daviddmd
Copy link

The Cloud Foundry V3 API reference specifies a manifest endpoint for apps that returns the computed app manifest YAML (string), matching the cloudfoundry-application-manifest.json schema.

I've added the get_manifest method to the AppManager class of the cloudfoundry_client/v3/apps.py module that consumes this API endpoint.

Example:

manifest: str = client.v3.apps.get_manifest(application_guid="97bcba72-43f2-4197-8136-fe178c22846f")
manifest_dict: dict = yaml.safe_load(manifest)

I've also introduced a fix to the _append_encoded_parameter function of the _get_url_filtered method of the entities module of the networking package, in order to append the GET parameters with the %s=%s format, in line with what the Policy Server API interface expects for its GET requests.

Example:

GET /networking/v1/external/policies
GET /networking/v1/external/policies?id=97bcba72-43f2-4197-8136-fe178c22846f
GET /networking/v1/external/policies?dest_id=8e05d3db-bebf-4373-a9f7-c68686aea169

As of now, the following doesn't work as intended:

client.networking_v1_external.policies.list(**{"id":"97bcba72-43f2-4197-8136-fe178c22846f"})

Expected: https://<cf-instance>/networking/v1/external/policies?id=97bcba72-43f2-4197-8136-fe178c22846f

Actual: https://<cf-instance>/networking/v1/external/policies?q=id%3A97bcba72-43f2-4197-8136-fe178c22846f, which yields all network policies present in the CF instance.

daviddmd added 2 commits June 27, 2025 16:38
fix(networking): Update _append_encoded_parameter function to append the parameters with the %s=%s format, in order to be compliant with the Policy Server API interface
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

Successfully merging this pull request may close these issues.

1 participant