Skip to content

Commit

Permalink
chore: new errors for service registry (#538)
Browse files Browse the repository at this point in the history
  • Loading branch information
wtrocki authored Jul 21, 2022
1 parent 217bf4f commit e660b42
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 3 deletions.
34 changes: 33 additions & 1 deletion .errors/errors_srs_mgmt.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"kind": "ErrorList",
"page": 1,
"size": 10,
"size": 100,
"total": 14,
"items": [
{
Expand Down Expand Up @@ -83,6 +83,38 @@
"code": "SRS-MGMT-10",
"reason": "Bad request format - unsupported media type",
"operation_id": ""
},
{
"id": "11",
"kind": "Error",
"href": "/api/serviceregistry_mgmt/v1/errors/11",
"code": "SRS-MGMT-11",
"reason": "Could not check quota for user?",
"operation_id": ""
},
{
"id": "12",
"kind": "Error",
"href": "/api/serviceregistry_mgmt/v1/errors/12",
"code": "SRS-MGMT-12",
"reason": "Evaluation instances not allowed.",
"operation_id": ""
},
{
"id": "13",
"kind": "Error",
"href": "/api/serviceregistry_mgmt/v1/errors/13",
"code": "SRS-MGMT-13",
"reason": "User already has the maximum number of allowed Evaluation instances.",
"operation_id": ""
},
{
"id": "14",
"kind": "Error",
"href": "/api/serviceregistry_mgmt/v1/errors/14",
"code": "SRS-MGMT-14",
"reason": "Total (global) number of instances exhausted.",
"operation_id": ""
}
]
}
12 changes: 12 additions & 0 deletions registrymgmt/apiv1/error/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,16 @@ const (
// Bad request format - unsupported media type
ERROR_10 string = "SRS-MGMT-10"

// Could not check quota for user?
ERROR_11 string = "SRS-MGMT-11"

// Evaluation instances not allowed.
ERROR_12 string = "SRS-MGMT-12"

// User already has the maximum number of allowed Evaluation instances.
ERROR_13 string = "SRS-MGMT-13"

// Total (global) number of instances exhausted.
ERROR_14 string = "SRS-MGMT-14"

)
4 changes: 2 additions & 2 deletions scripts/errors/fetch-errors.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ echo "Fetching error specifications from backends"

curl https://api.stage.openshift.com/api/kafkas_mgmt/v1/errors | jq > $ERRORS_FOLDER/errors_kafka_mgmt.json

curl https://api.stage.openshift.com/api/serviceregistry_mgmt/v1/errors | jq > $ERRORS_FOLDER/errors_srs_mgmt.json
curl https://api.stage.openshift.com/api/serviceregistry_mgmt/v1/errors?size=100 | jq > $ERRORS_FOLDER/errors_srs_mgmt.json

## Not enabled yet
# curl https://api.stage.openshift.com/api/connector_mgmt/v1/errors | jq > errors_connector_mgmt.json

echo "Successfully fetched errors"
echo "Successfully fetched errors"

0 comments on commit e660b42

Please sign in to comment.