From f23c4adbefba0f5d2099ac16634988c51fb2ceec Mon Sep 17 00:00:00 2001 From: Rajendra Baviskar Date: Wed, 14 Sep 2022 23:41:16 -0700 Subject: [PATCH 1/2] [SPG-203] adding cluster API --- harness/nextgen/api_clusters.go | 664 ++++++++++++++++++ harness/nextgen/client.go | 3 + harness/nextgen/docs/ClusterBasicDto.md | 11 + harness/nextgen/docs/ClusterBatchRequest.md | 14 + harness/nextgen/docs/ClusterBatchResponse.md | 9 + harness/nextgen/docs/ClusterRequest.md | 13 + harness/nextgen/docs/ClusterResponse.md | 16 + harness/nextgen/docs/ClustersApi.md | 202 ++++++ .../docs/PageResponseClusterResponse.md | 15 + .../docs/ResponseDtoClusterBatchResponse.md | 12 + .../docs/ResponseDtoClusterResponse.md | 12 + .../ResponseDtoPageResponseClusterResponse.md | 12 + harness/nextgen/model_cluster_basic_dto.go | 20 + .../nextgen/model_cluster_batch_request.go | 26 + .../nextgen/model_cluster_batch_response.go | 16 + harness/nextgen/model_cluster_request.go | 24 + harness/nextgen/model_cluster_response.go | 30 + .../model_page_response_cluster_response.go | 20 + ...del_response_dto_cluster_batch_response.go | 17 + .../model_response_dto_cluster_response.go | 17 + ...onse_dto_page_response_cluster_response.go | 17 + 21 files changed, 1170 insertions(+) create mode 100644 harness/nextgen/api_clusters.go create mode 100644 harness/nextgen/docs/ClusterBasicDto.md create mode 100644 harness/nextgen/docs/ClusterBatchRequest.md create mode 100644 harness/nextgen/docs/ClusterBatchResponse.md create mode 100644 harness/nextgen/docs/ClusterRequest.md create mode 100644 harness/nextgen/docs/ClusterResponse.md create mode 100644 harness/nextgen/docs/ClustersApi.md create mode 100644 harness/nextgen/docs/PageResponseClusterResponse.md create mode 100644 harness/nextgen/docs/ResponseDtoClusterBatchResponse.md create mode 100644 harness/nextgen/docs/ResponseDtoClusterResponse.md create mode 100644 harness/nextgen/docs/ResponseDtoPageResponseClusterResponse.md create mode 100644 harness/nextgen/model_cluster_basic_dto.go create mode 100644 harness/nextgen/model_cluster_batch_request.go create mode 100644 harness/nextgen/model_cluster_batch_response.go create mode 100644 harness/nextgen/model_cluster_request.go create mode 100644 harness/nextgen/model_cluster_response.go create mode 100644 harness/nextgen/model_page_response_cluster_response.go create mode 100644 harness/nextgen/model_response_dto_cluster_batch_response.go create mode 100644 harness/nextgen/model_response_dto_cluster_response.go create mode 100644 harness/nextgen/model_response_dto_page_response_cluster_response.go diff --git a/harness/nextgen/api_clusters.go b/harness/nextgen/api_clusters.go new file mode 100644 index 00000000..b3ef6304 --- /dev/null +++ b/harness/nextgen/api_clusters.go @@ -0,0 +1,664 @@ + +/* + * Harness NextGen Software Delivery Platform API Reference + * + * This is the Open Api Spec 3 for the NextGen Manager. This is under active development. Beware of the breaking change with respect to the generated code stub + * + * API version: 3.0 + * Contact: contact@harness.io + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package nextgen + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type ClustersApiService service +/* +ClustersApiService Delete a Cluster by identifier + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param identifier Cluster Identifier for the entity + * @param accountIdentifier Account Identifier for the Entity. + * @param environmentIdentifier environmentIdentifier + * @param optional nil or *ClustersApiDeleteClusterOpts - Optional Parameters: + * @param "OrgIdentifier" (optional.String) - Organization Identifier for the Entity. + * @param "ProjectIdentifier" (optional.String) - Project Identifier for the Entity. + * @param "Scope" (optional.String) - Scope for the gitops cluster +@return ResponseDtoBoolean +*/ + +type ClustersApiDeleteClusterOpts struct { + OrgIdentifier optional.String + ProjectIdentifier optional.String + Scope optional.String +} + +func (a *ClustersApiService) DeleteCluster(ctx context.Context, identifier string, accountIdentifier string, environmentIdentifier string, localVarOptionals *ClustersApiDeleteClusterOpts) (ResponseDtoBoolean, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue ResponseDtoBoolean + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/gitops/clusters/{identifier}" + localVarPath = strings.Replace(localVarPath, "{"+"identifier"+"}", fmt.Sprintf("%v", identifier), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + localVarQueryParams.Add("accountIdentifier", parameterToString(accountIdentifier, "")) + if localVarOptionals != nil && localVarOptionals.OrgIdentifier.IsSet() { + localVarQueryParams.Add("orgIdentifier", parameterToString(localVarOptionals.OrgIdentifier.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.ProjectIdentifier.IsSet() { + localVarQueryParams.Add("projectIdentifier", parameterToString(localVarOptionals.ProjectIdentifier.Value(), "")) + } + localVarQueryParams.Add("environmentIdentifier", parameterToString(environmentIdentifier, "")) + if localVarOptionals != nil && localVarOptionals.Scope.IsSet() { + localVarQueryParams.Add("scope", parameterToString(localVarOptionals.Scope.Value(), "")) + } + // 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", "application/yaml"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 400 { + var v Failure + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 0 { + var v ResponseDtoBoolean + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ClustersApiService Gets a Cluster by identifier + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param identifier Cluster Identifier for the entity + * @param accountIdentifier Account Identifier for the Entity. + * @param environmentIdentifier environmentIdentifier + * @param optional nil or *ClustersApiGetClusterOpts - Optional Parameters: + * @param "OrgIdentifier" (optional.String) - Organization Identifier for the Entity. + * @param "ProjectIdentifier" (optional.String) - Project Identifier for the Entity. + * @param "Deleted" (optional.Bool) - Specify whether cluster is deleted or not +@return ResponseDtoClusterResponse +*/ + +type ClustersApiGetClusterOpts struct { + OrgIdentifier optional.String + ProjectIdentifier optional.String + Deleted optional.Bool +} + +func (a *ClustersApiService) GetCluster(ctx context.Context, identifier string, accountIdentifier string, environmentIdentifier string, localVarOptionals *ClustersApiGetClusterOpts) (ResponseDtoClusterResponse, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue ResponseDtoClusterResponse + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/gitops/clusters/{identifier}" + localVarPath = strings.Replace(localVarPath, "{"+"identifier"+"}", fmt.Sprintf("%v", identifier), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + localVarQueryParams.Add("accountIdentifier", parameterToString(accountIdentifier, "")) + if localVarOptionals != nil && localVarOptionals.OrgIdentifier.IsSet() { + localVarQueryParams.Add("orgIdentifier", parameterToString(localVarOptionals.OrgIdentifier.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.ProjectIdentifier.IsSet() { + localVarQueryParams.Add("projectIdentifier", parameterToString(localVarOptionals.ProjectIdentifier.Value(), "")) + } + localVarQueryParams.Add("environmentIdentifier", parameterToString(environmentIdentifier, "")) + if localVarOptionals != nil && localVarOptionals.Deleted.IsSet() { + localVarQueryParams.Add("deleted", parameterToString(localVarOptionals.Deleted.Value(), "")) + } + // 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", "application/yaml"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 400 { + var v Failure + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 0 { + var v ResponseDtoClusterResponse + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ClustersApiService Gets cluster list + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param accountIdentifier Account Identifier for the Entity. + * @param environmentIdentifier Environment Identifier of the clusters + * @param optional nil or *ClustersApiGetClusterListOpts - Optional Parameters: + * @param "Page" (optional.Int32) - Page Index of the results to fetch.Default Value: 0 + * @param "Size" (optional.Int32) - Results per page + * @param "OrgIdentifier" (optional.String) - Organization Identifier for the Entity. + * @param "ProjectIdentifier" (optional.String) - Project Identifier for the Entity. + * @param "SearchTerm" (optional.String) - The word to be searched and included in the list response + * @param "Identifiers" (optional.Interface of []string) - List of cluster identifiers + * @param "Sort" (optional.Interface of []string) - Specifies the sorting criteria of the list. Like sorting based on the last updated entity, alphabetical sorting in an ascending or descending order +@return ResponseDtoPageResponseClusterResponse +*/ + +type ClustersApiGetClusterListOpts struct { + Page optional.Int32 + Size optional.Int32 + OrgIdentifier optional.String + ProjectIdentifier optional.String + SearchTerm optional.String + Identifiers optional.Interface + Sort optional.Interface +} + +func (a *ClustersApiService) GetClusterList(ctx context.Context, accountIdentifier string, environmentIdentifier string, localVarOptionals *ClustersApiGetClusterListOpts) (ResponseDtoPageResponseClusterResponse, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue ResponseDtoPageResponseClusterResponse + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/gitops/clusters" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Page.IsSet() { + localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Size.IsSet() { + localVarQueryParams.Add("size", parameterToString(localVarOptionals.Size.Value(), "")) + } + localVarQueryParams.Add("accountIdentifier", parameterToString(accountIdentifier, "")) + if localVarOptionals != nil && localVarOptionals.OrgIdentifier.IsSet() { + localVarQueryParams.Add("orgIdentifier", parameterToString(localVarOptionals.OrgIdentifier.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.ProjectIdentifier.IsSet() { + localVarQueryParams.Add("projectIdentifier", parameterToString(localVarOptionals.ProjectIdentifier.Value(), "")) + } + localVarQueryParams.Add("environmentIdentifier", parameterToString(environmentIdentifier, "")) + if localVarOptionals != nil && localVarOptionals.SearchTerm.IsSet() { + localVarQueryParams.Add("searchTerm", parameterToString(localVarOptionals.SearchTerm.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Identifiers.IsSet() { + localVarQueryParams.Add("identifiers", parameterToString(localVarOptionals.Identifiers.Value(), "multi")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "multi")) + } + // 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", "application/yaml"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 400 { + var v Failure + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 0 { + var v ResponseDtoPageResponseClusterResponse + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ClustersApiService link a Cluster + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param accountIdentifier Account Identifier for the Entity. + * @param optional nil or *ClustersApiLinkClusterOpts - Optional Parameters: + * @param "Body" (optional.Interface of ClusterRequest) - Details of the createCluster to be linked +@return ResponseDtoClusterResponse +*/ + +type ClustersApiLinkClusterOpts struct { + Body optional.Interface +} + +func (a *ClustersApiService) LinkCluster(ctx context.Context, accountIdentifier string, localVarOptionals *ClustersApiLinkClusterOpts) (ResponseDtoClusterResponse, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue ResponseDtoClusterResponse + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/gitops/clusters" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + localVarQueryParams.Add("accountIdentifier", parameterToString(accountIdentifier, "")) + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "application/yaml"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json", "application/yaml"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 400 { + var v Failure + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 0 { + var v ResponseDtoClusterResponse + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ClustersApiService Link Clusters + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param accountIdentifier Account Identifier for the Entity. + * @param optional nil or *ClustersApiLinkClustersOpts - Optional Parameters: + * @param "Body" (optional.Interface of ClusterBatchRequest) - Details of the createCluster to be created +@return ResponseDtoClusterBatchResponse +*/ + +type ClustersApiLinkClustersOpts struct { + Body optional.Interface +} + +func (a *ClustersApiService) LinkClusters(ctx context.Context, accountIdentifier string, localVarOptionals *ClustersApiLinkClustersOpts) (ResponseDtoClusterBatchResponse, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue ResponseDtoClusterBatchResponse + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/gitops/clusters/batch" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + localVarQueryParams.Add("accountIdentifier", parameterToString(accountIdentifier, "")) + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "application/yaml"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json", "application/yaml"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 400 { + var v Failure + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 0 { + var v ResponseDtoClusterBatchResponse + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/harness/nextgen/client.go b/harness/nextgen/client.go index a071450e..8ba1e4db 100644 --- a/harness/nextgen/client.go +++ b/harness/nextgen/client.go @@ -66,6 +66,8 @@ type APIClient struct { AuthenticationSettingsApi *AuthenticationSettingsApiService + ClustersApi *ClustersApiService + CloudCostAnomaliesApi *CloudCostAnomaliesApiService CloudCostAutoStoppingFixedSchedulesApi *CloudCostAutoStoppingFixedSchedulesApiService @@ -204,6 +206,7 @@ func NewAPIClient(cfg *Configuration) *APIClient { c.AuditApi = (*AuditApiService)(&c.common) c.AuditFiltersApi = (*AuditFiltersApiService)(&c.common) c.AuthenticationSettingsApi = (*AuthenticationSettingsApiService)(&c.common) + c.ClustersApi = (*ClustersApiService)(&c.common) c.CloudCostAnomaliesApi = (*CloudCostAnomaliesApiService)(&c.common) c.CloudCostAutoStoppingFixedSchedulesApi = (*CloudCostAutoStoppingFixedSchedulesApiService)(&c.common) c.CloudCostAutoStoppingLoadBalancersApi = (*CloudCostAutoStoppingLoadBalancersApiService)(&c.common) diff --git a/harness/nextgen/docs/ClusterBasicDto.md b/harness/nextgen/docs/ClusterBasicDto.md new file mode 100644 index 00000000..8a9dc2ec --- /dev/null +++ b/harness/nextgen/docs/ClusterBasicDto.md @@ -0,0 +1,11 @@ +# ClusterBasicDto + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Identifier** | **string** | identifier of the cluster | [optional] [default to null] +**Name** | **string** | name of the cluster | [optional] [default to null] +**Scope** | **string** | scope at which the cluster exists in harness gitops, project vs org vs account | [optional] [default to null] + +[[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/harness/nextgen/docs/ClusterBatchRequest.md b/harness/nextgen/docs/ClusterBatchRequest.md new file mode 100644 index 00000000..24b66e76 --- /dev/null +++ b/harness/nextgen/docs/ClusterBatchRequest.md @@ -0,0 +1,14 @@ +# ClusterBatchRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**OrgIdentifier** | **string** | organization identifier of the cluster | [optional] [default to null] +**ProjectIdentifier** | **string** | project identifier of the cluster | [optional] [default to null] +**EnvRef** | **string** | environment identifier of the cluster | [default to null] +**LinkAllClusters** | **bool** | link all clusters | [optional] [default to null] +**SearchTerm** | **string** | search term if applicable. only valid if linking all clusters | [optional] [default to null] +**Clusters** | [**[]ClusterBasicDto**](ClusterBasicDTO.md) | list of cluster identifiers and names | [optional] [default to null] + +[[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/harness/nextgen/docs/ClusterBatchResponse.md b/harness/nextgen/docs/ClusterBatchResponse.md new file mode 100644 index 00000000..497f4e7b --- /dev/null +++ b/harness/nextgen/docs/ClusterBatchResponse.md @@ -0,0 +1,9 @@ +# ClusterBatchResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Linked** | **int64** | number of clusters linked | [optional] [default to null] + +[[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/harness/nextgen/docs/ClusterRequest.md b/harness/nextgen/docs/ClusterRequest.md new file mode 100644 index 00000000..df7b0cc3 --- /dev/null +++ b/harness/nextgen/docs/ClusterRequest.md @@ -0,0 +1,13 @@ +# ClusterRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Identifier** | **string** | identifier of the cluster | [optional] [default to null] +**OrgIdentifier** | **string** | organization identifier of the cluster | [optional] [default to null] +**ProjectIdentifier** | **string** | project identifier of the cluster | [optional] [default to null] +**EnvRef** | **string** | environment identifier of the cluster | [default to null] +**Scope** | **string** | scope at which the cluster exists in harness gitops, project vs org vs account | [optional] [default to null] + +[[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/harness/nextgen/docs/ClusterResponse.md b/harness/nextgen/docs/ClusterResponse.md new file mode 100644 index 00000000..b8f004ca --- /dev/null +++ b/harness/nextgen/docs/ClusterResponse.md @@ -0,0 +1,16 @@ +# ClusterResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClusterRef** | **string** | identifier of the gitops cluster | [optional] [default to null] +**OrgIdentifier** | **string** | organization identifier of the cluster | [optional] [default to null] +**ProjectIdentifier** | **string** | project identifier of the cluster | [optional] [default to null] +**AccountIdentifier** | **string** | account identifier of the cluster | [optional] [default to null] +**EnvRef** | **string** | environment identifier of the cluster | [default to null] +**LinkedAt** | **int64** | time at which the cluster was linked | [optional] [default to null] +**Scope** | **string** | scope at which the cluster exists in harness gitops, project vs org vs account | [optional] [default to null] +**Name** | **string** | name of the gitops cluster | [optional] [default to null] + +[[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/harness/nextgen/docs/ClustersApi.md b/harness/nextgen/docs/ClustersApi.md new file mode 100644 index 00000000..98d8bf2e --- /dev/null +++ b/harness/nextgen/docs/ClustersApi.md @@ -0,0 +1,202 @@ +# nextgen{{classname}} + +All URIs are relative to *https://qa.harness.io/gateway/ng/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteCluster**](ClustersApi.md#DeleteCluster) | **Delete** /gitops/clusters/{identifier} | Delete a Cluster by identifier +[**GetCluster**](ClustersApi.md#GetCluster) | **Get** /gitops/clusters/{identifier} | Gets a Cluster by identifier +[**GetClusterList**](ClustersApi.md#GetClusterList) | **Get** /gitops/clusters | Gets cluster list +[**LinkCluster**](ClustersApi.md#LinkCluster) | **Post** /gitops/clusters | link a Cluster +[**LinkClusters**](ClustersApi.md#LinkClusters) | **Post** /gitops/clusters/batch | Link Clusters + +# **DeleteCluster** +> ResponseDtoBoolean DeleteCluster(ctx, identifier, accountIdentifier, environmentIdentifier, optional) +Delete a Cluster by identifier + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **identifier** | **string**| Cluster Identifier for the entity | + **accountIdentifier** | **string**| Account Identifier for the Entity. | + **environmentIdentifier** | **string**| environmentIdentifier | + **optional** | ***ClustersApiDeleteClusterOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ClustersApiDeleteClusterOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **orgIdentifier** | **optional.String**| Organization Identifier for the Entity. | + **projectIdentifier** | **optional.String**| Project Identifier for the Entity. | + **scope** | **optional.String**| Scope for the gitops cluster | + +### Return type + +[**ResponseDtoBoolean**](ResponseDTOBoolean.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml + +[[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) + +# **GetCluster** +> ResponseDtoClusterResponse GetCluster(ctx, identifier, accountIdentifier, environmentIdentifier, optional) +Gets a Cluster by identifier + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **identifier** | **string**| Cluster Identifier for the entity | + **accountIdentifier** | **string**| Account Identifier for the Entity. | + **environmentIdentifier** | **string**| environmentIdentifier | + **optional** | ***ClustersApiGetClusterOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ClustersApiGetClusterOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **orgIdentifier** | **optional.String**| Organization Identifier for the Entity. | + **projectIdentifier** | **optional.String**| Project Identifier for the Entity. | + **deleted** | **optional.Bool**| Specify whether cluster is deleted or not | [default to false] + +### Return type + +[**ResponseDtoClusterResponse**](ResponseDTOClusterResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml + +[[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) + +# **GetClusterList** +> ResponseDtoPageResponseClusterResponse GetClusterList(ctx, accountIdentifier, environmentIdentifier, optional) +Gets cluster list + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **accountIdentifier** | **string**| Account Identifier for the Entity. | + **environmentIdentifier** | **string**| Environment Identifier of the clusters | + **optional** | ***ClustersApiGetClusterListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ClustersApiGetClusterListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **page** | **optional.Int32**| Page Index of the results to fetch.Default Value: 0 | [default to 0] + **size** | **optional.Int32**| Results per page | [default to 100] + **orgIdentifier** | **optional.String**| Organization Identifier for the Entity. | + **projectIdentifier** | **optional.String**| Project Identifier for the Entity. | + **searchTerm** | **optional.String**| The word to be searched and included in the list response | + **identifiers** | [**optional.Interface of []string**](string.md)| List of cluster identifiers | + **sort** | [**optional.Interface of []string**](string.md)| Specifies the sorting criteria of the list. Like sorting based on the last updated entity, alphabetical sorting in an ascending or descending order | + +### Return type + +[**ResponseDtoPageResponseClusterResponse**](ResponseDTOPageResponseClusterResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/yaml + +[[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) + +# **LinkCluster** +> ResponseDtoClusterResponse LinkCluster(ctx, accountIdentifier, optional) +link a Cluster + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **accountIdentifier** | **string**| Account Identifier for the Entity. | + **optional** | ***ClustersApiLinkClusterOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ClustersApiLinkClusterOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of ClusterRequest**](ClusterRequest.md)| Details of the createCluster to be linked | + +### Return type + +[**ResponseDtoClusterResponse**](ResponseDTOClusterResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, application/yaml + - **Accept**: application/json, application/yaml + +[[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) + +# **LinkClusters** +> ResponseDtoClusterBatchResponse LinkClusters(ctx, accountIdentifier, optional) +Link Clusters + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **accountIdentifier** | **string**| Account Identifier for the Entity. | + **optional** | ***ClustersApiLinkClustersOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ClustersApiLinkClustersOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of ClusterBatchRequest**](ClusterBatchRequest.md)| Details of the createCluster to be created | + +### Return type + +[**ResponseDtoClusterBatchResponse**](ResponseDTOClusterBatchResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, application/yaml + - **Accept**: application/json, application/yaml + +[[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) + diff --git a/harness/nextgen/docs/PageResponseClusterResponse.md b/harness/nextgen/docs/PageResponseClusterResponse.md new file mode 100644 index 00000000..9c7af794 --- /dev/null +++ b/harness/nextgen/docs/PageResponseClusterResponse.md @@ -0,0 +1,15 @@ +# PageResponseClusterResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TotalPages** | **int64** | | [optional] [default to null] +**TotalItems** | **int64** | | [optional] [default to null] +**PageItemCount** | **int64** | | [optional] [default to null] +**PageSize** | **int64** | | [optional] [default to null] +**Content** | [**[]ClusterResponse**](ClusterResponse.md) | | [optional] [default to null] +**PageIndex** | **int64** | | [optional] [default to null] +**Empty** | **bool** | | [optional] [default to null] + +[[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/harness/nextgen/docs/ResponseDtoClusterBatchResponse.md b/harness/nextgen/docs/ResponseDtoClusterBatchResponse.md new file mode 100644 index 00000000..689d2339 --- /dev/null +++ b/harness/nextgen/docs/ResponseDtoClusterBatchResponse.md @@ -0,0 +1,12 @@ +# ResponseDtoClusterBatchResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Status** | **string** | | [optional] [default to null] +**Data** | [***ClusterBatchResponse**](ClusterBatchResponse.md) | | [optional] [default to null] +**MetaData** | [***interface{}**](interface{}.md) | | [optional] [default to null] +**CorrelationId** | **string** | | [optional] [default to null] + +[[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/harness/nextgen/docs/ResponseDtoClusterResponse.md b/harness/nextgen/docs/ResponseDtoClusterResponse.md new file mode 100644 index 00000000..08e7bb5f --- /dev/null +++ b/harness/nextgen/docs/ResponseDtoClusterResponse.md @@ -0,0 +1,12 @@ +# ResponseDtoClusterResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Status** | **string** | | [optional] [default to null] +**Data** | [***ClusterResponse**](ClusterResponse.md) | | [optional] [default to null] +**MetaData** | [***interface{}**](interface{}.md) | | [optional] [default to null] +**CorrelationId** | **string** | | [optional] [default to null] + +[[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/harness/nextgen/docs/ResponseDtoPageResponseClusterResponse.md b/harness/nextgen/docs/ResponseDtoPageResponseClusterResponse.md new file mode 100644 index 00000000..cbc78c71 --- /dev/null +++ b/harness/nextgen/docs/ResponseDtoPageResponseClusterResponse.md @@ -0,0 +1,12 @@ +# ResponseDtoPageResponseClusterResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Status** | **string** | | [optional] [default to null] +**Data** | [***PageResponseClusterResponse**](PageResponseClusterResponse.md) | | [optional] [default to null] +**MetaData** | [***interface{}**](interface{}.md) | | [optional] [default to null] +**CorrelationId** | **string** | | [optional] [default to null] + +[[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/harness/nextgen/model_cluster_basic_dto.go b/harness/nextgen/model_cluster_basic_dto.go new file mode 100644 index 00000000..5c0f1180 --- /dev/null +++ b/harness/nextgen/model_cluster_basic_dto.go @@ -0,0 +1,20 @@ +/* + * Harness NextGen Software Delivery Platform API Reference + * + * This is the Open Api Spec 3 for the NextGen Manager. This is under active development. Beware of the breaking change with respect to the generated code stub + * + * API version: 3.0 + * Contact: contact@harness.io + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package nextgen + +// list of cluster identifiers and names +type ClusterBasicDto struct { + // identifier of the cluster + Identifier string `json:"identifier,omitempty"` + // name of the cluster + Name string `json:"name,omitempty"` + // scope at which the cluster exists in harness gitops, project vs org vs account + Scope string `json:"scope,omitempty"` +} diff --git a/harness/nextgen/model_cluster_batch_request.go b/harness/nextgen/model_cluster_batch_request.go new file mode 100644 index 00000000..f93991ff --- /dev/null +++ b/harness/nextgen/model_cluster_batch_request.go @@ -0,0 +1,26 @@ +/* + * Harness NextGen Software Delivery Platform API Reference + * + * This is the Open Api Spec 3 for the NextGen Manager. This is under active development. Beware of the breaking change with respect to the generated code stub + * + * API version: 3.0 + * Contact: contact@harness.io + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package nextgen + +// This is the ClusterBatchRequest entity defined in Harness +type ClusterBatchRequest struct { + // organization identifier of the cluster + OrgIdentifier string `json:"orgIdentifier,omitempty"` + // project identifier of the cluster + ProjectIdentifier string `json:"projectIdentifier,omitempty"` + // environment identifier of the cluster + EnvRef string `json:"envRef"` + // link all clusters + LinkAllClusters bool `json:"linkAllClusters,omitempty"` + // search term if applicable. only valid if linking all clusters + SearchTerm string `json:"searchTerm,omitempty"` + // list of cluster identifiers and names + Clusters []ClusterBasicDto `json:"clusters,omitempty"` +} diff --git a/harness/nextgen/model_cluster_batch_response.go b/harness/nextgen/model_cluster_batch_response.go new file mode 100644 index 00000000..2a00d4bf --- /dev/null +++ b/harness/nextgen/model_cluster_batch_response.go @@ -0,0 +1,16 @@ +/* + * Harness NextGen Software Delivery Platform API Reference + * + * This is the Open Api Spec 3 for the NextGen Manager. This is under active development. Beware of the breaking change with respect to the generated code stub + * + * API version: 3.0 + * Contact: contact@harness.io + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package nextgen + +// This is the Cluster Batch Response defined in Harness +type ClusterBatchResponse struct { + // number of clusters linked + Linked int64 `json:"linked,omitempty"` +} diff --git a/harness/nextgen/model_cluster_request.go b/harness/nextgen/model_cluster_request.go new file mode 100644 index 00000000..4d05db38 --- /dev/null +++ b/harness/nextgen/model_cluster_request.go @@ -0,0 +1,24 @@ +/* + * Harness NextGen Software Delivery Platform API Reference + * + * This is the Open Api Spec 3 for the NextGen Manager. This is under active development. Beware of the breaking change with respect to the generated code stub + * + * API version: 3.0 + * Contact: contact@harness.io + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package nextgen + +// This is the ClusterRequest entity defined in Harness +type ClusterRequest struct { + // identifier of the cluster + Identifier string `json:"identifier,omitempty"` + // organization identifier of the cluster + OrgIdentifier string `json:"orgIdentifier,omitempty"` + // project identifier of the cluster + ProjectIdentifier string `json:"projectIdentifier,omitempty"` + // environment identifier of the cluster + EnvRef string `json:"envRef"` + // scope at which the cluster exists in harness gitops, project vs org vs account + Scope string `json:"scope,omitempty"` +} diff --git a/harness/nextgen/model_cluster_response.go b/harness/nextgen/model_cluster_response.go new file mode 100644 index 00000000..323268a7 --- /dev/null +++ b/harness/nextgen/model_cluster_response.go @@ -0,0 +1,30 @@ +/* + * Harness NextGen Software Delivery Platform API Reference + * + * This is the Open Api Spec 3 for the NextGen Manager. This is under active development. Beware of the breaking change with respect to the generated code stub + * + * API version: 3.0 + * Contact: contact@harness.io + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package nextgen + +// This is the ClusterRequest entity defined in Harness +type ClusterResponse struct { + // identifier of the gitops cluster + ClusterRef string `json:"clusterRef,omitempty"` + // organization identifier of the cluster + OrgIdentifier string `json:"orgIdentifier,omitempty"` + // project identifier of the cluster + ProjectIdentifier string `json:"projectIdentifier,omitempty"` + // account identifier of the cluster + AccountIdentifier string `json:"accountIdentifier,omitempty"` + // environment identifier of the cluster + EnvRef string `json:"envRef"` + // time at which the cluster was linked + LinkedAt int64 `json:"linkedAt,omitempty"` + // scope at which the cluster exists in harness gitops, project vs org vs account + Scope string `json:"scope,omitempty"` + // name of the gitops cluster + Name string `json:"name,omitempty"` +} diff --git a/harness/nextgen/model_page_response_cluster_response.go b/harness/nextgen/model_page_response_cluster_response.go new file mode 100644 index 00000000..981dd704 --- /dev/null +++ b/harness/nextgen/model_page_response_cluster_response.go @@ -0,0 +1,20 @@ +/* + * Harness NextGen Software Delivery Platform API Reference + * + * This is the Open Api Spec 3 for the NextGen Manager. This is under active development. Beware of the breaking change with respect to the generated code stub + * + * API version: 3.0 + * Contact: contact@harness.io + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package nextgen + +type PageResponseClusterResponse struct { + TotalPages int64 `json:"totalPages,omitempty"` + TotalItems int64 `json:"totalItems,omitempty"` + PageItemCount int64 `json:"pageItemCount,omitempty"` + PageSize int64 `json:"pageSize,omitempty"` + Content []ClusterResponse `json:"content,omitempty"` + PageIndex int64 `json:"pageIndex,omitempty"` + Empty bool `json:"empty,omitempty"` +} diff --git a/harness/nextgen/model_response_dto_cluster_batch_response.go b/harness/nextgen/model_response_dto_cluster_batch_response.go new file mode 100644 index 00000000..7a694b38 --- /dev/null +++ b/harness/nextgen/model_response_dto_cluster_batch_response.go @@ -0,0 +1,17 @@ +/* + * Harness NextGen Software Delivery Platform API Reference + * + * This is the Open Api Spec 3 for the NextGen Manager. This is under active development. Beware of the breaking change with respect to the generated code stub + * + * API version: 3.0 + * Contact: contact@harness.io + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package nextgen + +type ResponseDtoClusterBatchResponse struct { + Status string `json:"status,omitempty"` + Data *ClusterBatchResponse `json:"data,omitempty"` + MetaData *interface{} `json:"metaData,omitempty"` + CorrelationId string `json:"correlationId,omitempty"` +} diff --git a/harness/nextgen/model_response_dto_cluster_response.go b/harness/nextgen/model_response_dto_cluster_response.go new file mode 100644 index 00000000..c3a566bb --- /dev/null +++ b/harness/nextgen/model_response_dto_cluster_response.go @@ -0,0 +1,17 @@ +/* + * Harness NextGen Software Delivery Platform API Reference + * + * This is the Open Api Spec 3 for the NextGen Manager. This is under active development. Beware of the breaking change with respect to the generated code stub + * + * API version: 3.0 + * Contact: contact@harness.io + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package nextgen + +type ResponseDtoClusterResponse struct { + Status string `json:"status,omitempty"` + Data *ClusterResponse `json:"data,omitempty"` + MetaData *interface{} `json:"metaData,omitempty"` + CorrelationId string `json:"correlationId,omitempty"` +} diff --git a/harness/nextgen/model_response_dto_page_response_cluster_response.go b/harness/nextgen/model_response_dto_page_response_cluster_response.go new file mode 100644 index 00000000..9e648e35 --- /dev/null +++ b/harness/nextgen/model_response_dto_page_response_cluster_response.go @@ -0,0 +1,17 @@ +/* + * Harness NextGen Software Delivery Platform API Reference + * + * This is the Open Api Spec 3 for the NextGen Manager. This is under active development. Beware of the breaking change with respect to the generated code stub + * + * API version: 3.0 + * Contact: contact@harness.io + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package nextgen + +type ResponseDtoPageResponseClusterResponse struct { + Status string `json:"status,omitempty"` + Data *PageResponseClusterResponse `json:"data,omitempty"` + MetaData *interface{} `json:"metaData,omitempty"` + CorrelationId string `json:"correlationId,omitempty"` +} From 743fae07607e0f4691127edffa4c2ba36baa4cd1 Mon Sep 17 00:00:00 2001 From: Rajendra Baviskar Date: Wed, 14 Sep 2022 23:44:34 -0700 Subject: [PATCH 2/2] [SPG-203]: correcting the endpoint --- harness/nextgen/docs/ClustersApi.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/harness/nextgen/docs/ClustersApi.md b/harness/nextgen/docs/ClustersApi.md index 98d8bf2e..a6b6edf1 100644 --- a/harness/nextgen/docs/ClustersApi.md +++ b/harness/nextgen/docs/ClustersApi.md @@ -1,6 +1,6 @@ # nextgen{{classname}} -All URIs are relative to *https://qa.harness.io/gateway/ng/api* +All URIs are relative to *https://app.harness.io/gateway/ng/api* Method | HTTP request | Description ------------- | ------------- | -------------