Skip to content

Commit

Permalink
chore: auto update client api apecloud/apecloud@9bfe3b5
Browse files Browse the repository at this point in the history
  • Loading branch information
apecloud-bot committed Jan 7, 2025
1 parent 325c039 commit aba2402
Show file tree
Hide file tree
Showing 7 changed files with 235 additions and 1 deletion.
37 changes: 37 additions & 0 deletions .generator/schemas/adminapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2244,6 +2244,16 @@ paths:
name: operatorId
schema:
type: integer
- description: the pageNumber of the query
in: query
name: pageNumber
schema:
type: integer
- description: the pageSize of the query
in: query
name: pageSize
schema:
type: integer
- $ref: '#/components/parameters/startTime'
- $ref: '#/components/parameters/endTime'
responses:
Expand All @@ -2261,6 +2271,33 @@ paths:
$ref: '#/components/responses/404'
tags:
- event
/admin/v1/events/{eventID}:
get:
description: Retrieves detailed information about an event based on the provided Event ID.
summary: Query event detail by Event ID
operationId: queryEventDetail
parameters:
- description: Unique identifier for the event.
in: path
name: eventID
required: true
schema:
type: string
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/cluster_event'
description: Successful operation
'401':
$ref: '#/components/responses/401'
'403':
$ref: '#/components/responses/403'
'404':
$ref: '#/components/responses/404'
tags:
- event
/admin/v1/organizations/{orgName}/clusters/{clusterName}/parameterHistories:
get:
operationId: listParametersHistory
Expand Down
33 changes: 33 additions & 0 deletions .generator/schemas/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,39 @@ paths:
$ref: '#/components/responses/404'
tags:
- event
/api/v1/organizations/{orgName}/events/{eventID}:
get:
description: Retrieves detailed information about an event based on the provided Event ID.
summary: Query event detail by Event ID
operationId: queryEventDetail
parameters:
- description: Organization Name
in: path
name: orgName
required: true
schema:
type: string
- description: Unique identifier for the event.
in: path
name: eventID
required: true
schema:
type: string
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/event'
description: Successful operation
'401':
$ref: '#/components/responses/401'
'403':
$ref: '#/components/responses/403'
'404':
$ref: '#/components/responses/404'
tags:
- event
/api/v1/organizations/{orgName}/parameters:
get:
operationId: listOrgParameters
Expand Down
2 changes: 1 addition & 1 deletion apecloud
Submodule apecloud updated from 539e4e to 9bfe3b
91 changes: 91 additions & 0 deletions api/kbcloud/admin/api_event.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
_context "context"
_nethttp "net/http"
_neturl "net/url"
"strings"

"github.com/apecloud/kb-cloud-client-go/api/common"
)
Expand All @@ -22,6 +23,8 @@ type QueryClusterEventsOptionalParameters struct {
ResourceType *string
EventName *string
OperatorId *int32
PageNumber *int32
PageSize *int32
}

// NewQueryClusterEventsOptionalParameters creates an empty struct for parameters.
Expand Down Expand Up @@ -60,6 +63,18 @@ func (r *QueryClusterEventsOptionalParameters) WithOperatorId(operatorId int32)
return r
}

// WithPageNumber sets the corresponding parameter name and returns the struct.
func (r *QueryClusterEventsOptionalParameters) WithPageNumber(pageNumber int32) *QueryClusterEventsOptionalParameters {
r.PageNumber = &pageNumber
return r
}

// WithPageSize sets the corresponding parameter name and returns the struct.
func (r *QueryClusterEventsOptionalParameters) WithPageSize(pageSize int32) *QueryClusterEventsOptionalParameters {
r.PageSize = &pageSize
return r
}

// QueryClusterEvents Query operation events.
// Query events of clusters
func (a *EventApi) QueryClusterEvents(ctx _context.Context, start int64, end int64, o ...QueryClusterEventsOptionalParameters) (EventList, *_nethttp.Response, error) {
Expand Down Expand Up @@ -104,6 +119,82 @@ func (a *EventApi) QueryClusterEvents(ctx _context.Context, start int64, end int
if optionalParams.OperatorId != nil {
localVarQueryParams.Add("operatorId", common.ParameterToString(*optionalParams.OperatorId, ""))
}
if optionalParams.PageNumber != nil {
localVarQueryParams.Add("pageNumber", common.ParameterToString(*optionalParams.PageNumber, ""))
}
if optionalParams.PageSize != nil {
localVarQueryParams.Add("pageSize", common.ParameterToString(*optionalParams.PageSize, ""))
}
localVarHeaderParams["Accept"] = "application/json"

common.SetAuthKeys(
ctx,
&localVarHeaderParams,
[2]string{"BearerToken", "authorization"},
)
req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil)
if err != nil {
return localVarReturnValue, nil, err
}

localVarHTTPResponse, err := a.Client.CallAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}

localVarBody, err := common.ReadBody(localVarHTTPResponse)
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}

if localVarHTTPResponse.StatusCode >= 300 {
newErr := common.GenericOpenAPIError{
ErrorBody: localVarBody,
ErrorMessage: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 {
var v APIErrorResponse
err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.ErrorModel = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}

err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := common.GenericOpenAPIError{
ErrorBody: localVarBody,
ErrorMessage: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}

return localVarReturnValue, localVarHTTPResponse, nil
}

// QueryEventDetail Query event detail by Event ID.
// Retrieves detailed information about an event based on the provided Event ID.
func (a *EventApi) QueryEventDetail(ctx _context.Context, eventId string) (Cluster_event, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
localVarPostBody interface{}
localVarReturnValue Cluster_event
)

localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EventApi.QueryEventDetail")
if err != nil {
return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()}
}

localVarPath := localBasePath + "/admin/v1/events/{eventID}"
localVarPath = strings.Replace(localVarPath, "{"+"eventID"+"}", _neturl.PathEscape(common.ParameterToString(eventId, "")), -1)

localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
localVarHeaderParams["Accept"] = "application/json"

common.SetAuthKeys(
Expand Down
1 change: 1 addition & 0 deletions api/kbcloud/admin/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@
// - [environmentApi.scaleOutEnvironmentNodes]
// - [environmentApi.uncordonEnvironmentNode]
// - [eventApi.queryClusterEvents]
// - [eventApi.queryEventDetail]
// - [faultApi.createClusterNetworkChaos]
// - [faultApi.createClusterPodChaos]
// - [faultApi.deleteFault]
Expand Down
71 changes: 71 additions & 0 deletions api/kbcloud/api_event.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,77 @@ func (a *EventApi) QueryClusterEvents(ctx _context.Context, orgName string, star
return localVarReturnValue, localVarHTTPResponse, nil
}

// QueryEventDetail Query event detail by Event ID.
// Retrieves detailed information about an event based on the provided Event ID.
func (a *EventApi) QueryEventDetail(ctx _context.Context, orgName string, eventId string) (Event, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
localVarPostBody interface{}
localVarReturnValue Event
)

localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, ".EventApi.QueryEventDetail")
if err != nil {
return localVarReturnValue, nil, common.GenericOpenAPIError{ErrorMessage: err.Error()}
}

localVarPath := localBasePath + "/api/v1/organizations/{orgName}/events/{eventID}"
localVarPath = strings.Replace(localVarPath, "{"+"orgName"+"}", _neturl.PathEscape(common.ParameterToString(orgName, "")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"eventID"+"}", _neturl.PathEscape(common.ParameterToString(eventId, "")), -1)

localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
localVarHeaderParams["Accept"] = "application/json"

common.SetAuthKeys(
ctx,
&localVarHeaderParams,
[2]string{"BearerToken", "authorization"},
)
req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil)
if err != nil {
return localVarReturnValue, nil, err
}

localVarHTTPResponse, err := a.Client.CallAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}

localVarBody, err := common.ReadBody(localVarHTTPResponse)
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}

if localVarHTTPResponse.StatusCode >= 300 {
newErr := common.GenericOpenAPIError{
ErrorBody: localVarBody,
ErrorMessage: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 {
var v APIErrorResponse
err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.ErrorModel = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}

err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := common.GenericOpenAPIError{
ErrorBody: localVarBody,
ErrorMessage: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}

return localVarReturnValue, localVarHTTPResponse, nil
}

// NewEventApi Returns NewEventApi.
func NewEventApi(client *common.APIClient) *EventApi {
return &EventApi{
Expand Down
1 change: 1 addition & 0 deletions api/kbcloud/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@
// - [environmentApi.listEnvironment]
// - [environmentApi.listNodeGroup]
// - [eventApi.queryClusterEvents]
// - [eventApi.queryEventDetail]
// - [featureApi.listFeature]
// - [featureApi.readFeature]
// - [inspectionApi.createAutoInspection]
Expand Down

0 comments on commit aba2402

Please sign in to comment.