Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/generate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
- run: wget https://github.com/mikefarah/yq/releases/download/v4.2.0/yq_linux_amd64 -O $HOME/.local/bin/yq && chmod +x $HOME/.local/bin/yq
- name: Generate API clients
run: ./scripts/generate.sh
- name: Generate Errors SDK
run: ./scripts/errors/generate-errors.sh
- uses: peter-evans/create-pull-request@v3
with:
title: "chore(all): re-generate OpenAPI client(s)"
Expand Down
11 changes: 6 additions & 5 deletions packages/kafka-instance-sdk/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ paths:
those records the requestor is authorized to view.
operationId: getTopics
parameters:
- description: Maximum number of topics to return on single page
- deprecated: true
description: Maximum number of topics to return
explode: true
in: query
name: size
name: limit
required: false
schema:
format: int32
type: integer
style: form
- description: Filter to apply when returning the list of topics
Expand Down Expand Up @@ -508,10 +508,11 @@ paths:
authorized to view.
operationId: getConsumerGroups
parameters:
- description: Maximum number of consumer groups to return on single page
- deprecated: true
description: Maximum number of consumer groups to return
explode: true
in: query
name: size
name: limit
required: false
schema:
type: integer
Expand Down
8 changes: 4 additions & 4 deletions packages/kafka-instance-sdk/docs/GroupsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ Name | Type | Description | Notes

## getConsumerGroups

> ConsumerGroupList getConsumerGroups(size, page, topic, groupIdFilter, order, orderKey)
> ConsumerGroupList getConsumerGroups(limit, page, topic, groupIdFilter, order, orderKey)

List of consumer groups in the Kafka instance.

Expand All @@ -198,14 +198,14 @@ public class Example {
Bearer.setAccessToken("YOUR ACCESS TOKEN");

GroupsApi apiInstance = new GroupsApi(defaultClient);
Integer size = 56; // Integer | Maximum number of consumer groups to return on single page
Integer limit = 56; // Integer | Maximum number of consumer groups to return
Integer page = 56; // Integer | The page when returning the list of consumer groups
String topic = "topic_example"; // String | Return consumer groups where the topic name contains with this value
String groupIdFilter = "groupIdFilter_example"; // String | Return the consumer groups where the ID contains with this value
String order = "asc"; // String | Order of the consumer groups sorting. Ascending order is used as default.
String orderKey = "name"; // String | Order key to sort the items by. Only the value 'name' is currently applicable.
try {
ConsumerGroupList result = apiInstance.getConsumerGroups(size, page, topic, groupIdFilter, order, orderKey);
ConsumerGroupList result = apiInstance.getConsumerGroups(limit, page, topic, groupIdFilter, order, orderKey);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling GroupsApi#getConsumerGroups");
Expand All @@ -223,7 +223,7 @@ public class Example {

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**size** | **Integer**| Maximum number of consumer groups to return on single page | [optional]
**limit** | **Integer**| Maximum number of consumer groups to return | [optional]
**page** | **Integer**| The page when returning the list of consumer groups | [optional]
**topic** | **String**| Return consumer groups where the topic name contains with this value | [optional]
**groupIdFilter** | **String**| Return the consumer groups where the ID contains with this value | [optional]
Expand Down
8 changes: 4 additions & 4 deletions packages/kafka-instance-sdk/docs/TopicsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ Name | Type | Description | Notes

## getTopics

> TopicsList getTopics(size, filter, page, order, orderKey)
> TopicsList getTopics(limit, filter, page, order, orderKey)

List of topics

Expand All @@ -266,13 +266,13 @@ public class Example {
Bearer.setAccessToken("YOUR ACCESS TOKEN");

TopicsApi apiInstance = new TopicsApi(defaultClient);
Integer size = 56; // Integer | Maximum number of topics to return on single page
Integer limit = 56; // Integer | Maximum number of topics to return
String filter = "filter_example"; // String | Filter to apply when returning the list of topics
Integer page = 56; // Integer | The page when returning the limit of requested topics.
String order = "asc"; // String | Order of the items sorting. Ascending order is used as default.
String orderKey = "name"; // String | Order key to sort the topics by.
try {
TopicsList result = apiInstance.getTopics(size, filter, page, order, orderKey);
TopicsList result = apiInstance.getTopics(limit, filter, page, order, orderKey);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling TopicsApi#getTopics");
Expand All @@ -290,7 +290,7 @@ public class Example {

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**size** | **Integer**| Maximum number of topics to return on single page | [optional]
**limit** | **Integer**| Maximum number of topics to return | [optional]
**filter** | **String**| Filter to apply when returning the list of topics | [optional]
**page** | **Integer**| The page when returning the limit of requested topics. | [optional]
**order** | **String**| Order of the items sorting. Ascending order is used as default. | [optional] [enum: asc, desc]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public ConsumerGroup getConsumerGroupById(String consumerGroupId, String order,
/**
* List of consumer groups in the Kafka instance.
* Returns a list of all consumer groups for a particular Kafka instance. The consumer groups returned are limited to those records the requestor is authorized to view.
* @param size Maximum number of consumer groups to return on single page (optional)
* @param limit Maximum number of consumer groups to return (optional)
* @param page The page when returning the list of consumer groups (optional)
* @param topic Return consumer groups where the topic name contains with this value (optional)
* @param groupIdFilter Return the consumer groups where the ID contains with this value (optional)
Expand All @@ -145,7 +145,7 @@ public ConsumerGroup getConsumerGroupById(String consumerGroupId, String order,
* @return a {@code ConsumerGroupList}
* @throws ApiException if fails to make API call
*/
public ConsumerGroupList getConsumerGroups(Integer size, Integer page, String topic, String groupIdFilter, String order, String orderKey) throws ApiException {
public ConsumerGroupList getConsumerGroups(Integer limit, Integer page, String topic, String groupIdFilter, String order, String orderKey) throws ApiException {
Object localVarPostBody = null;

// create path and map variables
Expand All @@ -157,7 +157,7 @@ public ConsumerGroupList getConsumerGroups(Integer size, Integer page, String to
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();

localVarQueryParams.addAll(apiClient.parameterToPairs("", "size", size));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "topic", topic));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "group-id-filter", groupIdFilter));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,15 +171,15 @@ public Topic getTopic(String topicName) throws ApiException {
/**
* List of topics
* Returns a list of all of the available topics, or the list of topics that meet the request query parameters. The topics returned are limited to those records the requestor is authorized to view.
* @param size Maximum number of topics to return on single page (optional)
* @param limit Maximum number of topics to return (optional)
* @param filter Filter to apply when returning the list of topics (optional)
* @param page The page when returning the limit of requested topics. (optional)
* @param order Order of the items sorting. Ascending order is used as default. (optional)
* @param orderKey Order key to sort the topics by. (optional)
* @return a {@code TopicsList}
* @throws ApiException if fails to make API call
*/
public TopicsList getTopics(Integer size, String filter, Integer page, String order, String orderKey) throws ApiException {
public TopicsList getTopics(Integer limit, String filter, Integer page, String order, String orderKey) throws ApiException {
Object localVarPostBody = null;

// create path and map variables
Expand All @@ -191,7 +191,7 @@ public TopicsList getTopics(Integer size, String filter, Integer page, String or
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();

localVarQueryParams.addAll(apiClient.parameterToPairs("", "size", size));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter", filter));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "order", order));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
package com.openshift.cloud.api.kas;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

/**
* Contains the possible error codes returned by API
*/
public enum ApiErrorType {

/** Forbidden to perform this action*/
ERROR_4("KAFKAS-MGMT-4"),

/** Forbidden to create more instances than the maximum allowed*/
ERROR_5("KAFKAS-MGMT-5"),

/** An entity with the specified unique values already exists*/
ERROR_6("KAFKAS-MGMT-6"),

/** Resource not found*/
ERROR_7("KAFKAS-MGMT-7"),

/** General validation failure*/
ERROR_8("KAFKAS-MGMT-8"),

/** Unspecified error*/
ERROR_9("KAFKAS-MGMT-9"),

/** HTTP Method not implemented for this endpoint*/
ERROR_10("KAFKAS-MGMT-10"),

/** Account is unauthorized to perform this action*/
ERROR_11("KAFKAS-MGMT-11"),

/** Required terms have not been accepted*/
ERROR_12("KAFKAS-MGMT-12"),

/** Account authentication could not be verified*/
ERROR_15("KAFKAS-MGMT-15"),

/** Unable to read request body*/
ERROR_17("KAFKAS-MGMT-17"),

/** Bad request*/
ERROR_21("KAFKAS-MGMT-21"),

/** Failed to parse search query*/
ERROR_23("KAFKAS-MGMT-23"),

/** The maximum number of allowed kafka instances has been reached*/
ERROR_24("KAFKAS-MGMT-24"),

/** Resource gone*/
ERROR_25("KAFKAS-MGMT-25"),

/** Provider not supported*/
ERROR_30("KAFKAS-MGMT-30"),

/** Region not supported*/
ERROR_31("KAFKAS-MGMT-31"),

/** Kafka cluster name is invalid*/
ERROR_32("KAFKAS-MGMT-32"),

/** Minimum field length not reached*/
ERROR_33("KAFKAS-MGMT-33"),

/** Maximum field length has been depassed*/
ERROR_34("KAFKAS-MGMT-34"),

/** Only multiAZ Kafkas are supported, use multi_az=true*/
ERROR_35("KAFKAS-MGMT-35"),

/** Kafka cluster name is already used*/
ERROR_36("KAFKAS-MGMT-36"),

/** Field validation failed*/
ERROR_37("KAFKAS-MGMT-37"),

/** Service account name is invalid*/
ERROR_38("KAFKAS-MGMT-38"),

/** Service account desc is invalid*/
ERROR_39("KAFKAS-MGMT-39"),

/** Service account id is invalid*/
ERROR_40("KAFKAS-MGMT-40"),

/** Instance Type not supported*/
ERROR_41("KAFKAS-MGMT-41"),

/** Synchronous action is not supported, use async=true parameter*/
ERROR_103("KAFKAS-MGMT-103"),

/** Failed to create kafka client in the mas sso*/
ERROR_106("KAFKAS-MGMT-106"),

/** Failed to get kafka client secret from the mas sso*/
ERROR_107("KAFKAS-MGMT-107"),

/** Failed to get kafka client from the mas sso*/
ERROR_108("KAFKAS-MGMT-108"),

/** Failed to delete kafka client from the mas sso*/
ERROR_109("KAFKAS-MGMT-109"),

/** Failed to create service account*/
ERROR_110("KAFKAS-MGMT-110"),

/** Failed to get service account*/
ERROR_111("KAFKAS-MGMT-111"),

/** Failed to delete service account*/
ERROR_112("KAFKAS-MGMT-112"),

/** Failed to find service account*/
ERROR_113("KAFKAS-MGMT-113"),

/** Insufficient quota*/
ERROR_120("KAFKAS-MGMT-120"),

/** Failed to check quota*/
ERROR_121("KAFKAS-MGMT-121"),

/** Too Many requests*/
ERROR_429("KAFKAS-MGMT-429"),

/** An unexpected error happened, please check the log of the service for details*/
ERROR_1000("KAFKAS-MGMT-1000");



private String value;

ApiErrorType(String value) {
this.value = value;
}

@JsonValue
public String getValue() {
return value;
}

@Override
public String toString() {
return String.valueOf(value);
}

@JsonCreator
public static ApiErrorType fromValue(String value) {
for (ApiErrorType b : ApiErrorType.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
package com.openshift.cloud.api.srs;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

/**
* Contains the possible error codes returned by API
*/
public enum ApiErrorType {

/** Unspecified error*/
ERROR_1("SRS-MGMT-1"),

/** Registry with id='?' not found*/
ERROR_2("SRS-MGMT-2"),

/** Bad date or time format*/
ERROR_3("SRS-MGMT-3"),

/** Invalid request content. Make sure the request conforms to the given JSON schema*/
ERROR_4("SRS-MGMT-4"),

/** Bad request format - invalid JSON*/
ERROR_5("SRS-MGMT-5"),

/** Required terms have not been accepted for account id='?'*/
ERROR_6("SRS-MGMT-6"),

/** The maximum number of allowed Registry instances has been reached*/
ERROR_7("SRS-MGMT-7"),

/** Error type with id='?' not found*/
ERROR_8("SRS-MGMT-8"),

/** Data conflict. Make sure a Registry with the given name does not already exist*/
ERROR_9("SRS-MGMT-9"),

/** Bad request format - unsupported media type*/
ERROR_10("SRS-MGMT-10");



private String value;

ApiErrorType(String value) {
this.value = value;
}

@JsonValue
public String getValue() {
return value;
}

@Override
public String toString() {
return String.valueOf(value);
}

@JsonCreator
public static ApiErrorType fromValue(String value) {
for (ApiErrorType b : ApiErrorType.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
}