From d1fd35809073b801031b8f47475311dd1f250eab Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Tue, 28 Nov 2023 14:32:46 +0100 Subject: [PATCH] add cluster health --- .openapi-generator/FILES | 2 + README.md | 6 +- api/openapi.yaml | 75 +++++++- api_nodes.go | 104 ++++++++++- docs/GetHealth200Response.md | 198 ++++++++++++++++++++ docs/NodesApi.md | 70 ++++++- model_get_health_200_response.go | 311 +++++++++++++++++++++++++++++++ 7 files changed, 756 insertions(+), 10 deletions(-) create mode 100644 docs/GetHealth200Response.md create mode 100644 model_get_health_200_response.go diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 3ae0bd9..6495a78 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -22,6 +22,7 @@ docs/ClusterLayout.md docs/CreateBucketRequest.md docs/CreateBucketRequestLocalAlias.md docs/CreateBucketRequestLocalAliasAllow.md +docs/GetHealth200Response.md docs/GetNodes200Response.md docs/ImportKeyRequest.md docs/KeyApi.md @@ -62,6 +63,7 @@ model_cluster_layout.go model_create_bucket_request.go model_create_bucket_request_local_alias.go model_create_bucket_request_local_alias_allow.go +model_get_health_200_response.go model_get_nodes_200_response.go model_import_key_request.go model_key_info.go diff --git a/README.md b/README.md index 2bc6a03..6ba34fa 100644 --- a/README.md +++ b/README.md @@ -102,8 +102,9 @@ Class | Method | HTTP request | Description *LayoutApi* | [**ApplyLayout**](docs/LayoutApi.md#applylayout) | **Post** /layout/apply | Apply staged layout *LayoutApi* | [**GetLayout**](docs/LayoutApi.md#getlayout) | **Get** /layout | Details on the current and staged layout *LayoutApi* | [**RevertLayout**](docs/LayoutApi.md#revertlayout) | **Post** /layout/revert | Clear staged layout -*NodesApi* | [**AddNode**](docs/NodesApi.md#addnode) | **Post** /connect | Connect target node to other Garage nodes -*NodesApi* | [**GetNodes**](docs/NodesApi.md#getnodes) | **Get** /status | Status of this node and other nodes in the cluster +*NodesApi* | [**AddNode**](docs/NodesApi.md#addnode) | **Post** /connect | Connect a new node +*NodesApi* | [**GetHealth**](docs/NodesApi.md#gethealth) | **Get** /health | Cluster health report +*NodesApi* | [**GetNodes**](docs/NodesApi.md#getnodes) | **Get** /status | Describe cluster ## Documentation For Models @@ -121,6 +122,7 @@ Class | Method | HTTP request | Description - [CreateBucketRequest](docs/CreateBucketRequest.md) - [CreateBucketRequestLocalAlias](docs/CreateBucketRequestLocalAlias.md) - [CreateBucketRequestLocalAliasAllow](docs/CreateBucketRequestLocalAliasAllow.md) + - [GetHealth200Response](docs/GetHealth200Response.md) - [GetNodes200Response](docs/GetNodes200Response.md) - [ImportKeyRequest](docs/ImportKeyRequest.md) - [KeyInfo](docs/KeyInfo.md) diff --git a/api/openapi.yaml b/api/openapi.yaml index 64d13c6..3075224 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -12,6 +12,25 @@ servers: security: - bearerAuth: [] paths: + /health: + get: + description: | + Returns the global status of the cluster, the number of connected nodes (over the number of known ones), the number of healthy storage nodes (over the declared ones), and the number of healthy partitions (over the total). + operationId: GetHealth + responses: + "500": + description: | + The server can not answer your request because it is in a bad state + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetHealth_200_response' + description: | + Information about the queried node, its environment and the current layout + summary: Cluster health report + tags: + - Nodes /status: get: description: | @@ -34,7 +53,7 @@ paths: $ref: '#/components/schemas/GetNodes_200_response' description: | Information about the queried node, its environment and the current layout - summary: Status of this node and other nodes in the cluster + summary: Describe cluster tags: - Nodes /connect: @@ -74,7 +93,7 @@ paths: type: array description: | The request has been handled correctly but it does not mean that all connection requests succeeded; some might have fail, you need to check the body! - summary: Connect target node to other Garage nodes + summary: Connect a new node tags: - Nodes /layout: @@ -1153,6 +1172,58 @@ components: type: string type: array type: object + GetHealth_200_response: + example: + storageNodesOk: 3 + partitions: 256 + partitionsQuorum: 256 + knownNodes: 4 + connectedNodes: 4 + storageNodes: 3 + partitionsAllOk: 256 + status: healthy + properties: + status: + example: healthy + type: string + knownNodes: + example: 4 + format: int64 + type: integer + connectedNodes: + example: 4 + format: int64 + type: integer + storageNodes: + example: 3 + format: int64 + type: integer + storageNodesOk: + example: 3 + format: int64 + type: integer + partitions: + example: 256 + format: int64 + type: integer + partitionsQuorum: + example: 256 + format: int64 + type: integer + partitionsAllOk: + example: 256 + format: int64 + type: integer + required: + - connectedNodes + - knownNodes + - partitions + - partitionsAllOk + - partitionsQuorum + - status + - storageNodes + - storageNodesOk + type: object GetNodes_200_response: example: layout: diff --git a/api_nodes.go b/api_nodes.go index 6d1bdfa..168b61f 100644 --- a/api_nodes.go +++ b/api_nodes.go @@ -38,7 +38,7 @@ func (r ApiAddNodeRequest) Execute() ([]AddNode200ResponseInner, *http.Response, } /* -AddNode Connect target node to other Garage nodes +AddNode Connect a new node Instructs this Garage node to connect to other Garage nodes at specified `@`. `node_id` is generated automatically on node start. @@ -133,6 +133,106 @@ func (a *NodesApiService) AddNodeExecute(r ApiAddNodeRequest) ([]AddNode200Respo return localVarReturnValue, localVarHTTPResponse, nil } +type ApiGetHealthRequest struct { + ctx context.Context + ApiService *NodesApiService +} + +func (r ApiGetHealthRequest) Execute() (*GetHealth200Response, *http.Response, error) { + return r.ApiService.GetHealthExecute(r) +} + +/* +GetHealth Cluster health report + +Returns the global status of the cluster, the number of connected nodes (over the number of known ones), the number of healthy storage nodes (over the declared ones), and the number of healthy partitions (over the total). + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetHealthRequest +*/ +func (a *NodesApiService) GetHealth(ctx context.Context) ApiGetHealthRequest { + return ApiGetHealthRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return GetHealth200Response +func (a *NodesApiService) GetHealthExecute(r ApiGetHealthRequest) (*GetHealth200Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetHealth200Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NodesApiService.GetHealth") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/health" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + type ApiGetNodesRequest struct { ctx context.Context ApiService *NodesApiService @@ -143,7 +243,7 @@ func (r ApiGetNodesRequest) Execute() (*GetNodes200Response, *http.Response, err } /* -GetNodes Status of this node and other nodes in the cluster +GetNodes Describe cluster Returns the cluster's current status, including: - ID of the node being queried and its version of the Garage daemon diff --git a/docs/GetHealth200Response.md b/docs/GetHealth200Response.md new file mode 100644 index 0000000..ba37c1f --- /dev/null +++ b/docs/GetHealth200Response.md @@ -0,0 +1,198 @@ +# GetHealth200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Status** | **string** | | +**KnownNodes** | **int64** | | +**ConnectedNodes** | **int64** | | +**StorageNodes** | **int64** | | +**StorageNodesOk** | **int64** | | +**Partitions** | **int64** | | +**PartitionsQuorum** | **int64** | | +**PartitionsAllOk** | **int64** | | + +## Methods + +### NewGetHealth200Response + +`func NewGetHealth200Response(status string, knownNodes int64, connectedNodes int64, storageNodes int64, storageNodesOk int64, partitions int64, partitionsQuorum int64, partitionsAllOk int64, ) *GetHealth200Response` + +NewGetHealth200Response instantiates a new GetHealth200Response 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 + +### NewGetHealth200ResponseWithDefaults + +`func NewGetHealth200ResponseWithDefaults() *GetHealth200Response` + +NewGetHealth200ResponseWithDefaults instantiates a new GetHealth200Response 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 + +### GetStatus + +`func (o *GetHealth200Response) GetStatus() string` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *GetHealth200Response) GetStatusOk() (*string, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *GetHealth200Response) SetStatus(v string)` + +SetStatus sets Status field to given value. + + +### GetKnownNodes + +`func (o *GetHealth200Response) GetKnownNodes() int64` + +GetKnownNodes returns the KnownNodes field if non-nil, zero value otherwise. + +### GetKnownNodesOk + +`func (o *GetHealth200Response) GetKnownNodesOk() (*int64, bool)` + +GetKnownNodesOk returns a tuple with the KnownNodes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetKnownNodes + +`func (o *GetHealth200Response) SetKnownNodes(v int64)` + +SetKnownNodes sets KnownNodes field to given value. + + +### GetConnectedNodes + +`func (o *GetHealth200Response) GetConnectedNodes() int64` + +GetConnectedNodes returns the ConnectedNodes field if non-nil, zero value otherwise. + +### GetConnectedNodesOk + +`func (o *GetHealth200Response) GetConnectedNodesOk() (*int64, bool)` + +GetConnectedNodesOk returns a tuple with the ConnectedNodes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetConnectedNodes + +`func (o *GetHealth200Response) SetConnectedNodes(v int64)` + +SetConnectedNodes sets ConnectedNodes field to given value. + + +### GetStorageNodes + +`func (o *GetHealth200Response) GetStorageNodes() int64` + +GetStorageNodes returns the StorageNodes field if non-nil, zero value otherwise. + +### GetStorageNodesOk + +`func (o *GetHealth200Response) GetStorageNodesOk() (*int64, bool)` + +GetStorageNodesOk returns a tuple with the StorageNodes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStorageNodes + +`func (o *GetHealth200Response) SetStorageNodes(v int64)` + +SetStorageNodes sets StorageNodes field to given value. + + +### GetStorageNodesOk + +`func (o *GetHealth200Response) GetStorageNodesOk() int64` + +GetStorageNodesOk returns the StorageNodesOk field if non-nil, zero value otherwise. + +### GetStorageNodesOkOk + +`func (o *GetHealth200Response) GetStorageNodesOkOk() (*int64, bool)` + +GetStorageNodesOkOk returns a tuple with the StorageNodesOk field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStorageNodesOk + +`func (o *GetHealth200Response) SetStorageNodesOk(v int64)` + +SetStorageNodesOk sets StorageNodesOk field to given value. + + +### GetPartitions + +`func (o *GetHealth200Response) GetPartitions() int64` + +GetPartitions returns the Partitions field if non-nil, zero value otherwise. + +### GetPartitionsOk + +`func (o *GetHealth200Response) GetPartitionsOk() (*int64, bool)` + +GetPartitionsOk returns a tuple with the Partitions field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPartitions + +`func (o *GetHealth200Response) SetPartitions(v int64)` + +SetPartitions sets Partitions field to given value. + + +### GetPartitionsQuorum + +`func (o *GetHealth200Response) GetPartitionsQuorum() int64` + +GetPartitionsQuorum returns the PartitionsQuorum field if non-nil, zero value otherwise. + +### GetPartitionsQuorumOk + +`func (o *GetHealth200Response) GetPartitionsQuorumOk() (*int64, bool)` + +GetPartitionsQuorumOk returns a tuple with the PartitionsQuorum field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPartitionsQuorum + +`func (o *GetHealth200Response) SetPartitionsQuorum(v int64)` + +SetPartitionsQuorum sets PartitionsQuorum field to given value. + + +### GetPartitionsAllOk + +`func (o *GetHealth200Response) GetPartitionsAllOk() int64` + +GetPartitionsAllOk returns the PartitionsAllOk field if non-nil, zero value otherwise. + +### GetPartitionsAllOkOk + +`func (o *GetHealth200Response) GetPartitionsAllOkOk() (*int64, bool)` + +GetPartitionsAllOkOk returns a tuple with the PartitionsAllOk field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPartitionsAllOk + +`func (o *GetHealth200Response) SetPartitionsAllOk(v int64)` + +SetPartitionsAllOk sets PartitionsAllOk field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/NodesApi.md b/docs/NodesApi.md index dc108b7..fd5a6fd 100644 --- a/docs/NodesApi.md +++ b/docs/NodesApi.md @@ -4,8 +4,9 @@ All URIs are relative to *http://localhost:3903/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**AddNode**](NodesApi.md#AddNode) | **Post** /connect | Connect target node to other Garage nodes -[**GetNodes**](NodesApi.md#GetNodes) | **Get** /status | Status of this node and other nodes in the cluster +[**AddNode**](NodesApi.md#AddNode) | **Post** /connect | Connect a new node +[**GetHealth**](NodesApi.md#GetHealth) | **Get** /health | Cluster health report +[**GetNodes**](NodesApi.md#GetNodes) | **Get** /status | Describe cluster @@ -13,7 +14,7 @@ Method | HTTP request | Description > []AddNode200ResponseInner AddNode(ctx).RequestBody(requestBody).Execute() -Connect target node to other Garage nodes +Connect a new node @@ -75,11 +76,72 @@ Name | Type | Description | Notes [[Back to README]](../README.md) +## GetHealth + +> GetHealth200Response GetHealth(ctx).Execute() + +Cluster health report + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.NodesApi.GetHealth(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `NodesApi.GetHealth``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetHealth`: GetHealth200Response + fmt.Fprintf(os.Stdout, "Response from `NodesApi.GetHealth`: %v\n", resp) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetHealthRequest struct via the builder pattern + + +### Return type + +[**GetHealth200Response**](GetHealth200Response.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### 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) + + ## GetNodes > GetNodes200Response GetNodes(ctx).Execute() -Status of this node and other nodes in the cluster +Describe cluster diff --git a/model_get_health_200_response.go b/model_get_health_200_response.go new file mode 100644 index 0000000..6d26344 --- /dev/null +++ b/model_get_health_200_response.go @@ -0,0 +1,311 @@ +/* +Garage Administration API v0+garage-v0.9.0 + +Administrate your Garage cluster programatically, including status, layout, keys, buckets, and maintainance tasks. *Disclaimer: The API is not stable yet, hence its v0 tag. The API can change at any time, and changes can include breaking backward compatibility. Read the changelog and upgrade your scripts before upgrading. Additionnaly, this specification is very early stage and can contain bugs, especially on error return codes/types that are not tested yet. Do not expect a well finished and polished product!* + +API version: v0.9.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package garage + +import ( + "encoding/json" +) + +// GetHealth200Response struct for GetHealth200Response +type GetHealth200Response struct { + Status string `json:"status"` + KnownNodes int64 `json:"knownNodes"` + ConnectedNodes int64 `json:"connectedNodes"` + StorageNodes int64 `json:"storageNodes"` + StorageNodesOk int64 `json:"storageNodesOk"` + Partitions int64 `json:"partitions"` + PartitionsQuorum int64 `json:"partitionsQuorum"` + PartitionsAllOk int64 `json:"partitionsAllOk"` +} + +// NewGetHealth200Response instantiates a new GetHealth200Response 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 +func NewGetHealth200Response(status string, knownNodes int64, connectedNodes int64, storageNodes int64, storageNodesOk int64, partitions int64, partitionsQuorum int64, partitionsAllOk int64) *GetHealth200Response { + this := GetHealth200Response{} + this.Status = status + this.KnownNodes = knownNodes + this.ConnectedNodes = connectedNodes + this.StorageNodes = storageNodes + this.StorageNodesOk = storageNodesOk + this.Partitions = partitions + this.PartitionsQuorum = partitionsQuorum + this.PartitionsAllOk = partitionsAllOk + return &this +} + +// NewGetHealth200ResponseWithDefaults instantiates a new GetHealth200Response 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 +func NewGetHealth200ResponseWithDefaults() *GetHealth200Response { + this := GetHealth200Response{} + return &this +} + +// GetStatus returns the Status field value +func (o *GetHealth200Response) GetStatus() string { + if o == nil { + var ret string + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *GetHealth200Response) GetStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *GetHealth200Response) SetStatus(v string) { + o.Status = v +} + +// GetKnownNodes returns the KnownNodes field value +func (o *GetHealth200Response) GetKnownNodes() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.KnownNodes +} + +// GetKnownNodesOk returns a tuple with the KnownNodes field value +// and a boolean to check if the value has been set. +func (o *GetHealth200Response) GetKnownNodesOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.KnownNodes, true +} + +// SetKnownNodes sets field value +func (o *GetHealth200Response) SetKnownNodes(v int64) { + o.KnownNodes = v +} + +// GetConnectedNodes returns the ConnectedNodes field value +func (o *GetHealth200Response) GetConnectedNodes() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.ConnectedNodes +} + +// GetConnectedNodesOk returns a tuple with the ConnectedNodes field value +// and a boolean to check if the value has been set. +func (o *GetHealth200Response) GetConnectedNodesOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.ConnectedNodes, true +} + +// SetConnectedNodes sets field value +func (o *GetHealth200Response) SetConnectedNodes(v int64) { + o.ConnectedNodes = v +} + +// GetStorageNodes returns the StorageNodes field value +func (o *GetHealth200Response) GetStorageNodes() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.StorageNodes +} + +// GetStorageNodesOk returns a tuple with the StorageNodes field value +// and a boolean to check if the value has been set. +func (o *GetHealth200Response) GetStorageNodesOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.StorageNodes, true +} + +// SetStorageNodes sets field value +func (o *GetHealth200Response) SetStorageNodes(v int64) { + o.StorageNodes = v +} + +// GetStorageNodesOk returns the StorageNodesOk field value +func (o *GetHealth200Response) GetStorageNodesOk() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.StorageNodesOk +} + +// GetStorageNodesOkOk returns a tuple with the StorageNodesOk field value +// and a boolean to check if the value has been set. +func (o *GetHealth200Response) GetStorageNodesOkOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.StorageNodesOk, true +} + +// SetStorageNodesOk sets field value +func (o *GetHealth200Response) SetStorageNodesOk(v int64) { + o.StorageNodesOk = v +} + +// GetPartitions returns the Partitions field value +func (o *GetHealth200Response) GetPartitions() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Partitions +} + +// GetPartitionsOk returns a tuple with the Partitions field value +// and a boolean to check if the value has been set. +func (o *GetHealth200Response) GetPartitionsOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Partitions, true +} + +// SetPartitions sets field value +func (o *GetHealth200Response) SetPartitions(v int64) { + o.Partitions = v +} + +// GetPartitionsQuorum returns the PartitionsQuorum field value +func (o *GetHealth200Response) GetPartitionsQuorum() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.PartitionsQuorum +} + +// GetPartitionsQuorumOk returns a tuple with the PartitionsQuorum field value +// and a boolean to check if the value has been set. +func (o *GetHealth200Response) GetPartitionsQuorumOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.PartitionsQuorum, true +} + +// SetPartitionsQuorum sets field value +func (o *GetHealth200Response) SetPartitionsQuorum(v int64) { + o.PartitionsQuorum = v +} + +// GetPartitionsAllOk returns the PartitionsAllOk field value +func (o *GetHealth200Response) GetPartitionsAllOk() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.PartitionsAllOk +} + +// GetPartitionsAllOkOk returns a tuple with the PartitionsAllOk field value +// and a boolean to check if the value has been set. +func (o *GetHealth200Response) GetPartitionsAllOkOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.PartitionsAllOk, true +} + +// SetPartitionsAllOk sets field value +func (o *GetHealth200Response) SetPartitionsAllOk(v int64) { + o.PartitionsAllOk = v +} + +func (o GetHealth200Response) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["status"] = o.Status + } + if true { + toSerialize["knownNodes"] = o.KnownNodes + } + if true { + toSerialize["connectedNodes"] = o.ConnectedNodes + } + if true { + toSerialize["storageNodes"] = o.StorageNodes + } + if true { + toSerialize["storageNodesOk"] = o.StorageNodesOk + } + if true { + toSerialize["partitions"] = o.Partitions + } + if true { + toSerialize["partitionsQuorum"] = o.PartitionsQuorum + } + if true { + toSerialize["partitionsAllOk"] = o.PartitionsAllOk + } + return json.Marshal(toSerialize) +} + +type NullableGetHealth200Response struct { + value *GetHealth200Response + isSet bool +} + +func (v NullableGetHealth200Response) Get() *GetHealth200Response { + return v.value +} + +func (v *NullableGetHealth200Response) Set(val *GetHealth200Response) { + v.value = val + v.isSet = true +} + +func (v NullableGetHealth200Response) IsSet() bool { + return v.isSet +} + +func (v *NullableGetHealth200Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetHealth200Response(val *GetHealth200Response) *NullableGetHealth200Response { + return &NullableGetHealth200Response{value: val, isSet: true} +} + +func (v NullableGetHealth200Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetHealth200Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +