Skip to content

Commit

Permalink
Merge pull request #155 from harness/SPG-203-adding-cluster-api
Browse files Browse the repository at this point in the history
  • Loading branch information
abhinav-harness authored Sep 21, 2022
2 parents 1b13884 + 743fae0 commit 22fa475
Show file tree
Hide file tree
Showing 21 changed files with 1,170 additions and 0 deletions.
664 changes: 664 additions & 0 deletions harness/nextgen/api_clusters.go

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions harness/nextgen/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ type APIClient struct {

AuthenticationSettingsApi *AuthenticationSettingsApiService

ClustersApi *ClustersApiService

CloudCostAnomaliesApi *CloudCostAnomaliesApiService

CloudCostAutoStoppingFixedSchedulesApi *CloudCostAutoStoppingFixedSchedulesApiService
Expand Down Expand Up @@ -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)
Expand Down
11 changes: 11 additions & 0 deletions harness/nextgen/docs/ClusterBasicDto.md
Original file line number Diff line number Diff line change
@@ -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)

14 changes: 14 additions & 0 deletions harness/nextgen/docs/ClusterBatchRequest.md
Original file line number Diff line number Diff line change
@@ -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)

9 changes: 9 additions & 0 deletions harness/nextgen/docs/ClusterBatchResponse.md
Original file line number Diff line number Diff line change
@@ -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)

13 changes: 13 additions & 0 deletions harness/nextgen/docs/ClusterRequest.md
Original file line number Diff line number Diff line change
@@ -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)

16 changes: 16 additions & 0 deletions harness/nextgen/docs/ClusterResponse.md
Original file line number Diff line number Diff line change
@@ -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)

202 changes: 202 additions & 0 deletions harness/nextgen/docs/ClustersApi.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,202 @@
# nextgen{{classname}}

All URIs are relative to *https://app.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)

15 changes: 15 additions & 0 deletions harness/nextgen/docs/PageResponseClusterResponse.md
Original file line number Diff line number Diff line change
@@ -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)

12 changes: 12 additions & 0 deletions harness/nextgen/docs/ResponseDtoClusterBatchResponse.md
Original file line number Diff line number Diff line change
@@ -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)

12 changes: 12 additions & 0 deletions harness/nextgen/docs/ResponseDtoClusterResponse.md
Original file line number Diff line number Diff line change
@@ -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)

12 changes: 12 additions & 0 deletions harness/nextgen/docs/ResponseDtoPageResponseClusterResponse.md
Original file line number Diff line number Diff line change
@@ -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)

20 changes: 20 additions & 0 deletions harness/nextgen/model_cluster_basic_dto.go
Original file line number Diff line number Diff line change
@@ -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: [email protected]
* 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"`
}
26 changes: 26 additions & 0 deletions harness/nextgen/model_cluster_batch_request.go
Original file line number Diff line number Diff line change
@@ -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: [email protected]
* 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"`
}
Loading

0 comments on commit 22fa475

Please sign in to comment.