cloudfoundry-community / cloudfoundry-community/cf-python-client

Possibility to retrive includes?

オープン
#218 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
Python
スター
55
フォーク
54
PR マージ指標
30日以内にマージされた PR はありません

説明

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"

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

v3.apps.get(..., include="org") を使って例を再現し、その結果を基盤となるリクエストが返す payload と比較します。apps manager が API レスポンスをどのように処理するかを追跡し、含まれているデータが引き続き利用可能であることと、include="space.organization" に対する既存のナビゲーション動作が引き続き機能することを確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
api
issue の種類
機能追加
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。