cloudfoundry / cloudfoundry/cf-java-client

Error Status Codes from Cloud Foundry API V3

オープン
#1,180 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

question triaged
主要言語
Java
スター
334
フォーク
319
PR マージ指標
30日以内にマージされた PR はありません

説明

Hello everyone. Currently I am working on contribution for the get() operation for applicatons. The essence of contrubution is to migrate client implementation from v2 CF APIs to v3. In DefaultApplications Java class this method is used for getting Application details:

private static Mono<ApplicationInstancesResponse> getApplicationInstances(CloudFoundryClient
					cloudFoundryClient, String applicationId) {
	return requestApplicationInstances(cloudFoundryClient, applicationId)
	.onErrorResume(ExceptionUtils.statusCode(CF_BUILDPACK_COMPILED_FAILED, CF_INSTANCES_ERROR, 
	CF_STAGING_NOT_FINISHED, CF_STAGING_TIME_EXPIRED, CF_STAGING_ERROR),
	t -> Mono.just(ApplicationInstancesResponse.builder().build()));
}

Here we see the handling of various errors by their status codes. Method ExceptionUtils.statusCode just checks if at least one of the passed codes to this method matches the code returned from the API of the V2.

In the DefaultApplications defined following status codes:

private static final int CF_APP_STOPPED_STATS_ERROR = 200003;
    private static final int CF_BUILDPACK_COMPILED_FAILED = 170004;
    private static final int CF_INSTANCES_ERROR = 220001;
    private static final int CF_SERVICE_ALREADY_BOUND = 90003;
    private static final int CF_STAGING_ERROR = 170001;
    private static final int CF_STAGING_NOT_FINISHED = 170002;
    private static final int CF_STAGING_TIME_EXPIRED = 170007;

I want to ask a question where the list of these codes was taken from?
(I tried to find them in the CF API V2 documentation but didn't find them unfortunately.).

Also, do we have similar list of errors for CF V3 APIs? If we have could please share with me some sources, where I can find them? (I tried to find them there: https://v3-apidocs.cloudfoundry.org/version/3.131.0/index.html#errors) But it is common information about the errors and there we don't have info about the returning errors for a specific API endpoint.

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

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

はじめの一歩

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

調査の方向性

まず、DefaultApplications の getApplicationInstances の例と ExceptionUtils.statusCode の動作を読みます。列挙されている V2 ステータスコードを、issue にリンクされている Cloud Foundry API V3 のエラー ドキュメントと比較し、その後、エンドポイント固有のエラーについて信頼できる情報源を特定します。情報源を文書化するか、同等の一覧が存在しないことを確認できれば完了です。

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

評価

技術スタック
java
領域
api
issue の種類
ドキュメント
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

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

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