Skip to content

Commit

Permalink
chore: adjust examples to new breaking API
Browse files Browse the repository at this point in the history
  • Loading branch information
wtrocki committed Jun 1, 2021
1 parent e3f15ee commit 603c92c
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 18 deletions.
2 changes: 1 addition & 1 deletion examples/src/kafka.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const apiConfig = new Configuration({

const kafkaApi = new DefaultApi(apiConfig)

kafkaApi.listKafkas().then((data) => {
kafkaApi.getKafkas().then((data) => {
console.log(data?.data.items)
}).catch((err) => {
console.error(err.message)
Expand Down
4 changes: 2 additions & 2 deletions examples/src/kafkaInstance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ const apiConfig = new Configuration({
basePath
})

const registryApi = new DefaultApi(apiConfig)
const kafkaInstance = new DefaultApi(apiConfig)

registryApi.getTopicsList().then((data) => {
kafkaInstance.getTopics().then((data) => {
console.log(data?.data)
}).catch((err) => {
console.error(err.message)
Expand Down
2 changes: 1 addition & 1 deletion examples/src/serviceAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const apiConfig = new Configuration({

const kafkaApi = new SecurityApi(apiConfig)

kafkaApi.listServiceAccounts().then((data) => {
kafkaApi.getServiceAccounts().then((data) => {
console.log(data?.data.items)
}).catch((err) => {
console.error(err.message)
Expand Down
2 changes: 1 addition & 1 deletion examples/src/serviceRegistry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const apiConfig = new Configuration({

const registryApi = new DefaultApi(apiConfig)

registryApi.listRegistries().then((data) => {
registryApi.getRegistries().then((data) => {
console.log(data?.data)
}).catch((err) => {
console.error(err.message)
Expand Down
19 changes: 8 additions & 11 deletions packages/kafka-instance-sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ Provides SDK for interacting with Kafka instances
#### Install Package

```
npm install @rhoas/kafka-management-sdk --save
npm install @rhoas/kafka-instance-sdk --save
```

#### Usage

```ts
import { Configuration, DefaultApi } from "@rhoas/kafka-management-sdk";
import { Configuration, DefaultApi } from "@rhoas/kafka-instance-sdk";

const accessToken = process.env.CLOUD_API_TOKEN;
const basePath = "https://api.openshift.com";
Expand All @@ -26,16 +26,13 @@ const apiConfig = new Configuration({
basePath,
});

const kafkaApi = new DefaultApi(apiConfig);
const kafkaInstance = new DefaultApi(apiConfig)

kafkaApi
.listKafkas()
.then((data) => {
console.log(data?.data.items);
})
.catch((err) => {
console.error(err.message);
});
kafkaInstance.getTopics().then((data) => {
console.log(data?.data)
}).catch((err) => {
console.error(err.message)
})
```

See [./examples](https://github.com/redhat-developer/app-services-sdk-js/tree/main/examples) for full example
Expand Down
2 changes: 1 addition & 1 deletion packages/kafka-management-sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const apiConfig = new Configuration({
const kafkaApi = new DefaultApi(apiConfig);

kafkaApi
.listKafkas()
.getKafkas()
.then((data) => {
console.log(data?.data.items);
})
Expand Down
2 changes: 1 addition & 1 deletion packages/registry-management-sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const apiConfig = new Configuration({

const registryApi = new DefaultApi(apiConfig)

registryApi.listRegistries().then((data) => {
registryApi.getRegistries().then((data) => {
console.log(data?.data)
}).catch((err) => {
console.error(err.message)
Expand Down

0 comments on commit 603c92c

Please sign in to comment.