cloudfoundry-community / cloudfoundry-community/cf-python-client
Possibility to retrive includes?
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 55
- Forks
- 54
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
Hey, not sure if it's missing or I don't know how to exactly use it. However, I can't retrieve 'included' from any out of the box options eg. list, get, get_first. However, if I get retrieved payload from underlying methods then it's there. So I assume, parameter is passed while calling API, however, method returning payload only process 'resources' and 'included' is omitted.
Using CF CLI:
cf curl /v3/apps/9a81aaf5-7dac-4adc-a764-263b98935707?include=org | jq -r .included.organizations[].guid
42b716bb-42c5-4bcf-9c1c-f4be4d11685b
Using Python client:
app = client.v3.apps.get("9a81aaf5-7dac-4adc-a764-263b98935707", include="org")
print(json.dumps(app["included"], indent=4))
print(json.dumps(app["included"], indent=4))
KeyError: 'included'
By changing the first line only, a single request fetches all the data. The navigation from app to space and space to organization remains unchanged.
app = client.v3.apps.get("app-guid", include="space.organization")
The managers provide the same methods as the V2 managers with the following differences:
get(**kwargs): supports keyword arguments that are passed on to the API, e.g. "include"
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Reproduziere das Beispiel mit v3.apps.get(..., include="org") und vergleiche sein Ergebnis mit der Payload, die von der zugrunde liegenden Anfrage zurückgegeben wird. Verfolge, wie der apps manager API-Antworten verarbeitet, und überprüfe anschließend, dass die enthaltenen Daten weiterhin verfügbar sind und dass das bestehende Navigationsverhalten für include="space.organization" weiterhin funktioniert.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- api
- Issue-Typ
- Feature
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 45/100