Skip to content

Commit

Permalink
Add healthcheck API definition (#325)
Browse files Browse the repository at this point in the history
  • Loading branch information
longquanzheng committed Aug 17, 2023
1 parent c01cd95 commit edf8462
Show file tree
Hide file tree
Showing 8 changed files with 502 additions and 1 deletion.
2 changes: 2 additions & 0 deletions gen/iwfidl/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ docs/DefaultApi.md
docs/EncodedObject.md
docs/ErrorResponse.md
docs/ErrorSubStatus.md
docs/HealthInfo.md
docs/IDReusePolicy.md
docs/InterStateChannelCommand.md
docs/InterStateChannelPublishing.md
Expand Down Expand Up @@ -90,6 +91,7 @@ model_decider_trigger_type.go
model_encoded_object.go
model_error_response.go
model_error_sub_status.go
model_health_info.go
model_id_reuse_policy.go
model_inter_state_channel_command.go
model_inter_state_channel_publishing.go
Expand Down
2 changes: 2 additions & 0 deletions gen/iwfidl/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ Class | Method | HTTP request | Description
*DefaultApi* | [**ApiV1WorkflowStopPost**](docs/DefaultApi.md#apiv1workflowstoppost) | **Post** /api/v1/workflow/stop | stop a workflow
*DefaultApi* | [**ApiV1WorkflowTimerSkipPost**](docs/DefaultApi.md#apiv1workflowtimerskippost) | **Post** /api/v1/workflow/timer/skip | skip the timer of a workflow
*DefaultApi* | [**ApiV1WorkflowWorkerRpcPost**](docs/DefaultApi.md#apiv1workflowworkerrpcpost) | **Post** /api/v1/workflowWorker/rpc | for invoking workflow RPC API in the worker
*DefaultApi* | [**InfoHealthcheckGet**](docs/DefaultApi.md#infohealthcheckget) | **Get** /info/healthcheck | return health info of the server


## Documentation For Models
Expand All @@ -107,6 +108,7 @@ Class | Method | HTTP request | Description
- [EncodedObject](docs/EncodedObject.md)
- [ErrorResponse](docs/ErrorResponse.md)
- [ErrorSubStatus](docs/ErrorSubStatus.md)
- [HealthInfo](docs/HealthInfo.md)
- [IDReusePolicy](docs/IDReusePolicy.md)
- [InterStateChannelCommand](docs/InterStateChannelCommand.md)
- [InterStateChannelPublishing](docs/InterStateChannelPublishing.md)
Expand Down
23 changes: 23 additions & 0 deletions gen/iwfidl/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,16 @@ paths:
$ref: '#/components/schemas/ErrorResponse'
description: Invalid input
summary: dump internal info of a workflow
/info/healthcheck:
get:
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/HealthInfo'
description: successful operation
summary: return health info of the server
/api/v1/workflowState/start:
post:
requestBody:
Expand Down Expand Up @@ -659,6 +669,19 @@ components:
errorType:
type: string
type: object
HealthInfo:
example:
duration: 0
condition: condition
hostname: hostname
properties:
condition:
type: string
hostname:
type: string
duration:
type: integer
type: object
ErrorResponse:
properties:
detail:
Expand Down
110 changes: 110 additions & 0 deletions gen/iwfidl/api_default.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

60 changes: 60 additions & 0 deletions gen/iwfidl/docs/DefaultApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Method | HTTP request | Description
[**ApiV1WorkflowStopPost**](DefaultApi.md#ApiV1WorkflowStopPost) | **Post** /api/v1/workflow/stop | stop a workflow
[**ApiV1WorkflowTimerSkipPost**](DefaultApi.md#ApiV1WorkflowTimerSkipPost) | **Post** /api/v1/workflow/timer/skip | skip the timer of a workflow
[**ApiV1WorkflowWorkerRpcPost**](DefaultApi.md#ApiV1WorkflowWorkerRpcPost) | **Post** /api/v1/workflowWorker/rpc | for invoking workflow RPC API in the worker
[**InfoHealthcheckGet**](DefaultApi.md#InfoHealthcheckGet) | **Get** /info/healthcheck | return health info of the server



Expand Down Expand Up @@ -1038,3 +1039,62 @@ No authorization required
[[Back to Model list]](../README.md#documentation-for-models)
[[Back to README]](../README.md)


## InfoHealthcheckGet

> HealthInfo InfoHealthcheckGet(ctx).Execute()
return health info of the server

### Example

```go
package main

import (
"context"
"fmt"
"os"
openapiclient "github.com/indeedeng/iwf-idl"
)

func main() {

configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.DefaultApi.InfoHealthcheckGet(context.Background()).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.InfoHealthcheckGet``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `InfoHealthcheckGet`: HealthInfo
fmt.Fprintf(os.Stdout, "Response from `DefaultApi.InfoHealthcheckGet`: %v\n", resp)
}
```

### Path Parameters

This endpoint does not need any parameter.

### Other Parameters

Other parameters are passed through a pointer to a apiInfoHealthcheckGetRequest struct via the builder pattern


### Return type

[**HealthInfo**](HealthInfo.md)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
[[Back to Model list]](../README.md#documentation-for-models)
[[Back to README]](../README.md)

108 changes: 108 additions & 0 deletions gen/iwfidl/docs/HealthInfo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# HealthInfo

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Condition** | Pointer to **string** | | [optional]
**Hostname** | Pointer to **string** | | [optional]
**Duration** | Pointer to **int32** | | [optional]

## Methods

### NewHealthInfo

`func NewHealthInfo() *HealthInfo`

NewHealthInfo instantiates a new HealthInfo object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed

### NewHealthInfoWithDefaults

`func NewHealthInfoWithDefaults() *HealthInfo`

NewHealthInfoWithDefaults instantiates a new HealthInfo object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set

### GetCondition

`func (o *HealthInfo) GetCondition() string`

GetCondition returns the Condition field if non-nil, zero value otherwise.

### GetConditionOk

`func (o *HealthInfo) GetConditionOk() (*string, bool)`

GetConditionOk returns a tuple with the Condition field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetCondition

`func (o *HealthInfo) SetCondition(v string)`

SetCondition sets Condition field to given value.

### HasCondition

`func (o *HealthInfo) HasCondition() bool`

HasCondition returns a boolean if a field has been set.

### GetHostname

`func (o *HealthInfo) GetHostname() string`

GetHostname returns the Hostname field if non-nil, zero value otherwise.

### GetHostnameOk

`func (o *HealthInfo) GetHostnameOk() (*string, bool)`

GetHostnameOk returns a tuple with the Hostname field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetHostname

`func (o *HealthInfo) SetHostname(v string)`

SetHostname sets Hostname field to given value.

### HasHostname

`func (o *HealthInfo) HasHostname() bool`

HasHostname returns a boolean if a field has been set.

### GetDuration

`func (o *HealthInfo) GetDuration() int32`

GetDuration returns the Duration field if non-nil, zero value otherwise.

### GetDurationOk

`func (o *HealthInfo) GetDurationOk() (*int32, bool)`

GetDurationOk returns a tuple with the Duration field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetDuration

`func (o *HealthInfo) SetDuration(v int32)`

SetDuration sets Duration field to given value.

### HasDuration

`func (o *HealthInfo) HasDuration() bool`

HasDuration returns a boolean if a field has been set.


[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


Loading

0 comments on commit edf8462

Please sign in to comment.